badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

Double title tag in the home page

Tagged: 

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #59735
    Alberto
    Participant

    In head I put personal title tag, but in source code show double title tag because there is also this. How can I remove it? (Only for the home page)

    <?php wp_head(); ?>

    #59775

    Hi,

    You can simply add below code to remove it only from the home page.

    <?php 
    if ( !is_front_page() ) {
        wp_head();
    }
    ?>

    Thank you for using our theme.

    #59786
    Alberto
    Participant

    So it does not show the home correctly

    #59794

    Hello Alberti,

    Yes those code will not shows the title on your homepage (front-page).

    Thank you!

    #59798
    Alberto
    Participant

    I’ll explain it better. In the home does not show the theme.

    #59956

    Sorry! Alberto We are not understanding what you are trying to achieve.
    Can you please clarify one more time. So that we can help you.

    Thank you!

    #59957
    Alberto
    Participant

    Your code hides the automatic title tag on the home page (in the source code), but it does not show the wp_portfolio theme, it shows the homepage as text without color, without formatting

    #59964
    Alberto
    Participant
    #59990
    Alberto
    Participant

    I solved it so, in the file functions.php child I put this code that reverses the sequence: now it shows the motto and then the title of the blog, this is important for SEO

    add_filter( 'pre_get_document_title', function( $title ) {
    
        if ( is_home() || is_front_page() ) {
    
            $title = get_bloginfo( 'description' ) .' | '.get_bloginfo( 'name' );
        }
         return $title;
    }
    );
    #60041

    Great to hear that you solve the problem. If you have any problem do not hesitate to contact us.

    Thank you!

    #60055
    Alberto
    Participant

    I solved but not completely. In the page source shows correct, but in google search it’s not good. You can see.

    https://albertifoto.it

    add_filter( 'pre_get_document_title', function( $title ) {
    
        if ( is_home() || is_front_page() ) {
    
            $title = get_bloginfo( 'description' ) .' - Portfolio | '. get_bloginfo( 'name' );
        }
         return $title;
    }
    );
Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.