Sitename not display in custom templates / custom theme

#868385
  • Resolved Wsch
    Rank Math free

    I’m having an issue with the display of the site title (sitename) in a custom theme that uses custom templates (such as template-home.php, template-membership.php, etc.). On these pages, the sitename is not being displayed correctly.

    Currently, it shows: <title>BAREFOOT deine Plattform für Yoga Reisen von Julia Baumann</title>

    Instead, it should show: <title>BAREFOOT deine Plattform für Yoga Reisen von Julia Baumann | Barefoot Yoga Urlaub</title>

    In the Title & Meta settings, it’s set to %title% %page% %sep% %sitename%. I suspect that these settings might not be applied to the custom template files.

    It works correctly on the archive pages. The Yoast SEO settings have been correctly applied.

    The project is currently running locally on my computer.

    Thank you in advance for your assistance!

Viewing 14 replies - 1 through 14 (of 14 total)
  • Hello,

    We apologize for the issue you are facing with the display of the site title in your custom theme. It seems that the Title & Meta settings you have configured may not be applied to your custom template files.

    To resolve this, you might need to ensure that the custom templates are correctly utilizing the Rank Math functions to generate the title tag. Here are a few steps you can take:

    1. Check Template Files: Ensure that your custom templates (like template-home.php, template-membership.php, etc.) include the necessary Rank Math functions to output the title. You can use rank_math_the_title() function in your template files to ensure that the title is generated according to your settings.

    2. Use the Correct Function: Instead of manually setting the title in your templates, use the Rank Math function to automatically pull in the settings you’ve configured in the dashboard. This will help ensure consistency across all pages.

    3. Debugging: If you are still having issues, consider checking for any conflicts with other plugins or themes that might be affecting how titles are displayed.

    If you need further assistance or specific guidance based on your website’s configuration, please reply to this ticket, and a human agent from the Rank Math Support team will overtake it and provide more tailored help.

    Thank you for raising this concern!

    Wsch
    Rank Math free

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hello,

    Thank you for your query and we are so sorry about the trouble this must have caused.

    For our variables to work properly in your custom template, please make sure you added the WordPress get_header() function or the get_header/wp_head must be initialized in the PHP file since Rank Math uses that to generate the title meta which consists of the preprocessing functions for the variables.

    Don’t hesitate to get in touch with us if you have any other questions.

    Wsch
    Rank Math free

    Hi Jeremy,

    thanks. The get_header() function is in every template file

    Link to Gitlab Repo

    Hello,

    Please share a screenshot of the source code of one of the pages where this is not working and make sure it includes all the metadata generation from our plugin, so we can check what’s getting added.

    Looking forward to hearing back from you.

    Wsch
    Rank Math free

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hello,

    According to the data in the Gitlab repository, you should have duplicate title tags. One is generated from the wp_head() function and one that is explicitly set in the code.

    It would seem like those templates are not getting the default header.php file because otherwise both should have been generated.

    You are also adding theme support for the title-tag but then include the title explicitly.

    Last but not least, it seems that you are using the PRO version of the plugin but we only see an active Free account, so please let us know the email address you used to make this purchase.

    Thank you.

    Wsch
    Rank Math free

    the custom title tag are commented-out in the header.php

    if i remove the title function in the function.php only the <meta property=“og:title” content=“Yoga Vacation & Yoga Retreats at BAREFOOT” /> is output and no <title>Yoga Vacation & Yoga Retreats at BAREFOOT</title>

    Hello,

    We just downloaded the theme into our local installation and it outputted the title as expected. It’s possible that you have page-specific settings for the title that don’t overwrite the global settings you have in the Titles & Meta settings.

    Please open a particular page where the templates are applied and check the page-specific settings you have for the meta title inside the Rank Math SEO controls.

    Don’t hesitate to get in touch if you have any other questions.

    Wsch
    Rank Math free

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Wsch
    Rank Math free

    Home: <title>Yoga Urlaub & Yoga Retreats bei BAREFOOT</title>
    Archive Page(CPT): <title>Hotels Archiv | BAREFOOT Yoga Urlaub</title>
    Other normal pages: <title>BAREFOOT deine Plattform für Yoga Reisen von Julia Baumann</title>

    on all normal pages with custom template files (template-home.php, template-specials.php,…) | Barefoot Yoga Urlaub not displayed.

    Hello,

    That must be something very specific to your website and the settings you have because using those templates is not causing any issues with the settings from our plugin on our local installation:
    Settings
    Template

    If you want our team to take a closer look you will need to set up a staging website so we can advise further.

    Thank you.

    Wsch
    Rank Math free

    we switched to an other Seo Plugin

    Hello,

    We’re sorry to hear that you’ve switched to another SEO plugin.

    If you ever decide to give Rank Math another try in the future or need any assistance, feel free to reach out.

    We’re always here to help.

    Thank you.

Viewing 14 replies - 1 through 14 (of 14 total)

You must be logged in to reply to this ticket.