Title Separator in Browser Tabs Not Working Correctly in Events Pages

Home Forums Calendar Products Events Calendar PRO Title Separator in Browser Tabs Not Working Correctly in Events Pages

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1400793
    Karl
    Participant

    Hello there-

    I’ve seen mention of this in various forum posts, and it looks as though the issue often comes down to SEO plugin conflicts. However, our site is not running any SEO plugin and is nevertheless encountering the following problem:

    Our site uses a single pipe (|) to separate the page name from the name of the site. We implemented this global change with a few simple lines in our functions.php file, basically swapping out the :: separator for the |.

    When we add a new event, no title separator or space appears between the event’s title and the site’s name in the browser tab for that event’s page. Instead, it looks like this: New EventWebsite Name.

    In addition, the upcoming events and past events pages are using a dash (-) as the title separator. For example, Upcoming Events-Website Name.

    For the sake of troubleshooting, we removed the functions.php code snippet we had used to modify our title separator. However, there was no change in TEC’s behavior with respect to the title separators in browser tabs.

    This suggests to us that the choice of title separator is being made somewhere in the TEC code. Is there a way for us to make it conform to our site’s current standard? To be clear, we’re not trying to change the system-generated titles themselves, We’re just trying to standardize the way titles are treated in the browser tabs.

    Thanks in advance for your help!

    #1401758
    Victor
    Keymaster

    Hi Karl!

    Thanks for reaching out to us! Let me help you with this topic.

    I think you can achieve what you are looking for by using the ‘tribe_events_title_tag‘ filter we provide. As a reference, you can find the filter in here > https://github.com/moderntribe/the-events-calendar/blob/master/src/Tribe/Template_Factory.php#L351

    We also have a good article that shows how you can customize the browser title by using that same filter > https://theeventscalendar.com/knowledgebase/changing-the-browser-title-for-calendar-views/

    I hope that helps. Let me know how that works for you.

    Best,
    Victor

    #1405126
    Karl
    Participant

    This reply is private.

    #1408942
    Victor
    Keymaster

    This reply is private.

    #1413590
    Victor
    Keymaster

    Hi Karl!

    Thanks for your patience while I tested this out.

    After a closer inspection in the code, I found that you can use the document_title_separator filter to change the default “-” separator across the site.

    Try pasting the following snippet into your theme’s functions.php file and see if it works:

    add_filter( 'document_title_separator', function() { return '|'; } );

    Let me know about it.

    Thanks,
    Victor

    #1422677
    Karl
    Participant

    Hi Victor-

    Thank you for your help with this–very much appreciated!

    Everything’s working exactly as expected now.

    Best,
    Karl

    #1423199
    Victor
    Keymaster

    Hey Karl! Glad to know that worked out for you! 🙂

    Thanks for following up to let us know about it.

    I’ll close this now, but feel free to open a new topic if anything comes up and we’ll be happy to help.

    Cheers,
    Victor

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Title Separator in Browser Tabs Not Working Correctly in Events Pages’ is closed to new replies.