Posted: March 22, 2018 at 8:57 am
|
I see that others have had the same problem, but nothing I try will remove ‘Events Archive’ from my events listing page title. I have this code in my functions.php in my child theme: add_filter(‘pre_get_document_title’, ‘ee_events_archive_titles’); function ee_events_archive_titles() { …but it does nothing. The event listing page is using a template called ‘archive-espresso_events.php’ Thanks |
Hi there, The Does your “archive-espresso_events.php” template have any code that outputs the “Events Archive” title heading? |
|
|
Sorry – the title tag is what I meant – the title in the tab of the page thats used for SEO. The template used is using the normal get_header() function as all the other WordPress pages. There’s nothing else within the template that has the word ‘archive’ apart from the name of the template file itself. |
In that case, your code as-is should have an effect, but would be less prone to conflicting with other pages if it was changed to this:
|
|
|
Still no luck. I guess I’ll need to leave it as it is. Thank you anyway Josh |
If you can send a copy of the theme to support[at]eventespresso.com we can take a quick look and see if anything stands out if you’d like? The above should work so we’d need to look over the code to see what is happening. |
|
It looks like Divi overrides the title with the same filter, if you look in the Divi theme, you’ll find this little gem:
When no priority is set, then WP defaults to priority 10. You can override their filter by setting a later priority (like 11) on your add_filter() call, e.g:
|
|
|
I didn’t understand a word of that, but it did the trick anyway! Had to go up to no.16. Thanks so much 🙂 |
There’s a well-written explanation about filter hooks in this article: |
|
The support post ‘Events Archive page title’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.