• Resolved GarCard

    (@garcard)


    I’m using The SEO Framework for all page titles. They are all custom titles. However, it appears the homepage title is not being displayed correctly. It’s only displaying as the Site Name. Even installing this plugin doesn’t fix it.

    Do you suggest a workaround other than just changing the name of the site?

    I’m using the Impreza theme.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hi @garcard,

    I hope you’re doing well :).

    Are you using caching plugins? If so, please see if clearing the cache works with this plugin active.

    If that doesn’t work, could you send me a zipped copy of the header.php file that comes with the theme? You can do so directly on my contact page, so I can take a closer look.

    Cheers!

    Thread Starter GarCard

    (@garcard)

    No caching plugins are being used. I sent you the header.php file(s). I should note that All In One SEO does work correctly (i.e., it does update the homepage title).

    Also this is basically the title area of the file:

    <?php /* Don't remove the semicolon in the title tag below: it's needed for Theme Check */ ?>
    <title><?php wp_title( '' ); ?></title>
    Plugin Author Sybre Waaijer

    (@cybr)

    Hi @garcard,

    With the title outputted like that, you shouldn’t even need the title fix plugin, as it’s correct :).

    Please check out the Home Page Settings on the global SEO Settings page. The output of the title are reflected there. You can configure the output there as well.

    SEO Settings - Home Page Settings Additions

    If you notice that the options set there aren’t reflected upon the actual output, do let me know.

    Cheers!

    Thread Starter GarCard

    (@garcard)

    Unfortunately I’ve tried that and it doesn’t seem to take affect. I tried updating the home page title at the Home page area itself, and also within those global settings. Neither one seems to work. ??

    None of the title changes I make to the Home Page settings seem to do anything, however the description works just fine.

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi @garcard,

    That’s odd ?? In fact, what you’re describing is impossible; unless some alterations directed at The SEO Framework have been made, or when the home page isn’t correctly detected.

    Is this issue also happening when you activate a default theme, like Twenty Sixteen?
    Also, could you share the URL with me where this issue occurs? If you’d rather keep it confidentially, you know where to send me a mail :).

    I await your response, cheers!

    Thread Starter GarCard

    (@garcard)

    I just tested on Twenty Sixteen, and everything seems OK with that theme. So looks like SOMETHING to do with the theme I’m using. I can provide the theme fileset if you’re interested in debugging.

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi @garcard,

    Thank you for providing me with more information through mail.
    I’ve concluded that the theme overwrites the title filter on the homepage within its framework (impreza/framework/framework.php).

    You can solve this issue with either of the three provided resolutions. They’re all requiring you to add the code to your theme functions.php file (pick one):

    1: While using this Title Fix extension, add this code:

    add_filter( 'the_seo_framework_force_title_fix', '__return_true' );
    

    2: (Recommended) While not using this Title Fix extension, add this code:

    function us_wp_title() { }
    

    3: While not using this Title Fix extension, add this code:

    add_action( 'after_theme_setup', 'my_remove_title_filter' );
    function my_remove_title_filter() { 
    	remove_filter( 'wp_title', 'us_wp_title' );
    }
    

    1. Forces the Title Fix to run, regardless of detection (it seemed to be correct).
    2. Forces the Title overwrite by the framework to fail, by it detecting the function’s existence.
    3. Removes the filter within the us_wp_title function.

    I’d go with 2 :). It’s the cleanest, fastest, most elegant and least resource intensive way.

    I hope this helps! Have a wonderful weekend!

    • This reply was modified 8 years, 3 months ago by Sybre Waaijer.
    Thread Starter GarCard

    (@garcard)

    #1 worked for me, so I’m using that for now
    #2 wouldn’t let me do it, because my Snippets plugin warned that it was already declared
    #3 simply didn’t work for me (not sure if it needs a higher priority?)

    Thanks for all the help. Not sure why the theme has do be this way in the first place, and also not sure why All-in-One SEO works right out of the box. ??

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi @garcard,

    How have you tried to implement #2 and #3?

    The snippets should be added through either your child theme’s functions.php file (recommended), through the main theme’s functions.php (not recommended as updates overwrite this), or your own plugin.

    With that in mind, #2 should work.

    For #3, I think the action should be later, this ought to work:

    add_action( 'template_redirect', 'my_remove_title_filter' );
    function my_remove_title_filter() { 
    	remove_filter( 'wp_title', 'us_wp_title' );
    }

    The reason why All-in-One works out of the box is because I believe (haven’t checked out their code) they also have a title fixer implemented; but that one’s then rather unforgiving (as the filter of #1 is).

    Best of luck ?? Cheers!

    Thread Starter GarCard

    (@garcard)

    As mentioned, #2 didn’t work for me. I use a plugin called Code Snippets, to add functions. However, when adding the function from #2, it said:

    The code snippet you are trying to save produced a fatal error on line 9:
    Cannot redeclare us_wp_title() (previously declared in /wp-content/themes/Impreza/framework/framework.php:171)

    And #3 didn’t seem to do anything to the title. HOWEVER, I’ve now used your new version you just mentioned for #3, and that works like a charm (without your Title Fix plugin). Cheers!

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi @garcard,

    The error would mean that the snippet functionality by the plugin is run later than the theme being set up.

    Nevertheless, #3 is the next-best thing and the performance difference compared to #2 lies at nanosecond level; thus very negligible.
    Therefore, I’m marking this topic as resolved.

    Best of luck with your websites and clients! ??
    And if you have any more questions, feel free to open up a new topic. Cheers!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Should this also be fixing the title for the homepage?’ is closed to new replies.