Home › Forums › Calendar Products › Events Calendar PRO › What is the page title filter?
- This topic has 8 replies, 2 voices, and was last updated 9 years, 9 months ago by Barry.
-
AuthorPosts
-
July 28, 2014 at 11:23 am #526985Nicholas RiosParticipant
Sorry, it’s been a second since I had to do some editing on this plugin, and I can’t find my way quickly to it in the plugin, nor can I find any examples on it using the search.
Is there a filter I can use to edit the page title?
I am trying to get it to say “Calendar – %sitename” instead of “Events – %sitename”
July 28, 2014 at 3:45 pm #528263BarryMemberHi!
You may need to tweak things to better fit your specific needs, but essentially a small snippet like this (operating on the wp_title filter hook) should work:
add_filter( 'wp_title', 'modify_the_title', 50 ); function modify_the_title( $title ) { return str_replace( 'Events', 'Calendar', $title ); }
Does that help/get you started in the right direction at least?
July 29, 2014 at 11:11 am #533652Nicholas RiosParticipantThank you, that does help, but I was hoping for a little bit of insight into where ECP is filtering wp_title itself, and hoping I could modify ECP’s title filtering.
I have found the function maybeAddEventTitle and can use the tribe_events_add_title filter. But this does not actually filter the ECP landing page title (the default calendar view), which shows as “Events >> %sitename” where %sitename is the actual site’s name.
July 30, 2014 at 9:02 am #540169BarryMemberI have found the function maybeAddEventTitle and can use the tribe_events_add_title filter. But this does not actually filter the ECP landing page title (the default calendar view), which shows as “Events >> %sitename”
Hmm, I’m not sure there is any other place … might a side effect of another plugin/your theme be at work here?
YES, I’ve deactivated all other plugins to check for a plugin conflict.
YES, I’ve reverted to the 2011 default WordPress theme (with other plugins still deactivated) to check for a theme conflict.I see you carried out the above steps which is great: can you confirm the title remained as Events » %sitename even under those conditions, rather than (for example) Upcoming Events | %sitename or Events for (date) | %sitename?
Thanks!
July 31, 2014 at 6:24 am #548258Nicholas RiosParticipantOK you caught me. Here are the various situations:
1- 2014 WP Theme, no other plugins: “Events this month | %sitename” on landing page calendar, otherwise (navigating in calendar): “Events for (date) | %sitename”
2- 2014 WP Theme, add WordPress SEO plugin: “Events | %sitename” on landing page calendar, otherwise: “Events for (date) | %sitename”
3- Genesis child theme (tested with just framework as well) activated, no other plugins: “Events this month” on landing page calendar, otherwise: “Events for (date)” (no sitename on either)
4- Genesis child theme, WordPress SEO: “Events – %sitename”, otherwise “Events for (date) |” (missing sitename on second)I’m not sure where the >> separator came from, or where it went. My original hope was to just replace where the word “Events” wherever it was entered in by ECP. I’m kind’ve confused where the simple “Events” one is coming from because I don’t see it even as an option in the plugin (only variations of it with the date).
Thanks for looking into it Barry.
July 31, 2014 at 7:48 am #548641Nicholas RiosParticipanthttps://theeventscalendar.com/support/forums/topic/yoast-ecl/
This contains the solution, specifically a variation of: https://gist.github.com/jo-snips/3710617
If I wasn’t only trying to change the main page, what I think I would do is filter wpseo_title with the above code combined with maybeAddEventTitle.
July 31, 2014 at 2:17 pm #550492BarryMemberOK, great – so you’re all sorted here?
August 1, 2014 at 5:55 am #556815Nicholas RiosParticipantGot it, thanks.
August 1, 2014 at 8:14 am #557744BarryMemberAwesome 🙂
I’ll go ahead and close this thread in that case but please do feel free to create new ones if you need assistance with anything else.
Thanks again!
-
AuthorPosts
- The topic ‘What is the page title filter?’ is closed to new replies.