Home Forums WoodMart support forum Portfolio detail page Title (H1)

Portfolio detail page Title (H1)

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #146544

    Colibri
    Participant

    Hi,

    In regards to the last week’s topic I’ve started for the H1 title of the single portfolio page. (see here https://xtemos.com/forums/topic/portfolio-detail-page-title-h1/), I’ve dicovered a bug. The main Services page (where you have the list of all the services) has now the H1 title the same as the first portfolio item.

    Can you adjust the code snippet previously provided to remedy this problem?

    #146555

    Artem Temos
    Keymaster

    Hi,

    Try to replace previous code with this one

    if ( is_singular( 'portfolio' ) ) {
        $title = get_the_title();
    }

    Regards

    #146564

    Colibri
    Participant

    The current code is:

    if( is_singular( ‘page’ ) && ( ! $page_for_posts || ! is_page( $page_for_posts ) ) ):
    $title = get_the_title();

    Do I also change the if before the line mentioned or just the second line?

    Thanks!

    #146571

    Artem Temos
    Keymaster

    We have you a single line only, replace that line with a new code https://xtemos.com/forums/topic/portfolio-detail-page-title-h1/#post-144339

    #146575

    Colibri
    Participant

    I’ve replaced as you said and now the code looks like this: http://prntscr.com/patq2b

    and the page looks like this: http://prntscr.com/patow0

    The title doesn’t show at all. I don’t think I did it right.

    #146586

    Artem Temos
    Keymaster

    Sorry, the code should be look like this https://prnt.sc/pasv3l

    $title = get_the_title( $page_for_projects );
    
    if ( is_singular( 'portfolio' ) ) {
        $title = get_the_title();
    }
    #146605

    Colibri
    Participant

    Thank you ! Now the title displays correctly, but the breadcrumb still says “project”

    See here: http://prntscr.com/pauvkn

    #146712

    Artem Temos
    Keymaster

    You can translate or edit all theme and plugin texts including this one via PO file in WordPress. Here is a video tutorial that should help you translate your website texts with a Loco Translate plugin https://www.youtube.com/watch?v=D3NsDdMzsls&list=PLMw6W4rAaOgKKv0oexGHzpWBg1imvrval&index=3

    We suggest you to keep translated files in wp-content/languages/themes/woodmart-pt_PT.po folder.

    #146722

    Colibri
    Participant

    When I first renamed the page Portfolio to Services the breadcrumb was displaying correctly.

    The thing is, I am already using WPML because the site is multi-language. I can translate the breadcrumb as a string for Romanian, but what can I do for the English version of the site, can it still be changed using the English PO files?

    Thanks for all the help so far!

    #146725

    Colibri
    Participant

    When you load the Services page (Portfolio list page) the breadcrumb displays like this: http://prntscr.com/pb52yj
    But, when you load a Single Portfolio page, the breadcrumb displays like this: http://prntscr.com/pb51sz

    Both breadcrumbs refer to the same page, there must be a bug in the code.

    I have also searched for the string “project” in the PO file and using WPML String Translation and I haven’t found it anywhere. So, I have no way to translate it or edit it.

    Hope you can help me out with this.

    #146738

    Artem Temos
    Keymaster

    Could you please send us your admin access so we can check why you can’t find it?

    #146823

    Colibri
    Participant

    Hi,

    I eventually found it (I was searching for it with lowercase). Now it works. Thank you for the help!

    My current problem in regards with this page’s translation is the slug. I have translated the Romanian version of the page and changed it’s slug to /servicii/. But, when I use the language switcher from English to Romanian, the url of the page keeps the /services/ slug, although if I type the translated version it’s also valid, and loads the same content. Please see the screen shots.

    I have also previously used a snippet of code that you provided from another topic regarding the changing of the slug:

    add_filter(‘register_post_type_args’, ‘portfolio_to_my_slug’, 10, 2);
    function portfolio_to_my_slug($args, $post_type){

    if ($post_type == ‘portfolio’){
    $args[‘rewrite’][‘slug’] = ‘services’;
    }

    return $args;
    }

    #146841

    Artem Temos
    Keymaster

    It seems to be a general WPML issue not related to the theme. Contact WPML support for in this situation.

Viewing 13 posts - 1 through 13 (of 13 total)