Home › Forums › Calendar Products › Events Calendar PRO › SEO title error since 3.5
- This topic has 5 replies, 2 voices, and was last updated 12 years ago by
Barry.
-
AuthorPosts
-
April 1, 2014 at 1:09 am #125921
Lars
Participant7. This doesn’t work for “Map View” since update 3.5:
// Runs the <title> element through our custom filter
// add_filter(‘wp_title’, ‘filter_events_title’);
// If you are using Yoast delete the above line and uncomment the following one
add_filter(‘wpseo_title’, ‘filter_events_title’);// Tribe events: Manually set title for each page
function filter_events_title ($title) {if ( tribe_is_map() && !is_tax() ) { // Map View Page
$title = ‘My Title Here’;
}
return $title;
}April 1, 2014 at 4:02 pm #126522Barry
MemberCertainly works for me, at least in the standard (non-WP SEO specific) form. Are you finding it is only a problem with WP SEO?
April 1, 2014 at 11:05 pm #126619Lars
ParticipantThis reply is private.
April 2, 2014 at 6:43 am #126748Barry
MemberIt seems to work as I would expect with default themes (of course, you need to uncomment the add_filter(‘wp_title’, ‘filter_events_title’) line for it to work in a non-WP SEO context). Possibly your theme or another plugin is also operating on the same filter?
With that in mind, perhaps you can you try increasing the priority of the filter?
add_filter(‘wp_title’, ‘filter_events_title’, 999);Unfortunately I’m afraid we can’t really assist much further as this is ultimately a customization. It does look like you are approaching things from the right angle, but figuring out if the filter function is being called and what happens after that (perhaps subsequent filters are being called) would be the next thing to investigate and we’d need to leave that to you.
April 2, 2014 at 7:30 am #126825Lars
Participant@Barry: I believe you ment: add_filter(‘wpseo_title’, ‘filter_events_title’, 999);
(how do you add the yellow block when you reply to me?)Anyway it didn’t help – and this is another bug that came with 3.5. It did work fine before updating to 3.5 and you provided the “Runs the <title> element through our custom filter” snippet yourselves to make a workaround for ECP not supporting Yoast SEO.
What we did find out is this:
The snippet below works showing custom title for “Week View” and “List View” but not for “Map View” :
// Runs the <title> element through our custom filter
// add_filter(‘wp_title’, ‘filter_events_title’);
// If you are using Yoast delete the above line and uncomment the following one
add_filter(‘wpseo_title’, ‘filter_events_title’);// Tribe events: Manually set title for each page
function filter_events_title ($title) {
if ( tribe_is_week() && !is_tax() ) { // Week View Page
$title = ‘Events – Danish Maritime Days’;
}
elseif ( tribe_is_upcoming() && !is_tax() ) { // List View Page: Upcoming Events
$title = ‘Upcoming Events – Danish Maritime Days’;
}
elseif ( tribe_is_map() && !is_tax() ) { // Map View Page
$title = ‘Upcoming Events – Danish Maritime Days’;
}
return $title;
}Changing add_filter(‘wpseo_title’, ‘filter_events_title’); to add_filter(‘wp_title’, ‘filter_events_title’); like shown below make “Map View” custom title show but then “Week View” and “List View” custom title doesn’t show !!! How do you explain that – unless something has been changed with 3.5?
// Runs the <title> element through our custom filter
add_filter(‘wp_title’, ‘filter_events_title’);
// If you are using Yoast delete the above line and uncomment the following one
// add_filter(‘wpseo_title’, ‘filter_events_title’);// Tribe events: Manually set title for each page
function filter_events_title ($title) {
if ( tribe_is_week() && !is_tax() ) { // Week View Page
$title = ‘Events – Danish Maritime Days’;
}
elseif ( tribe_is_upcoming() && !is_tax() ) { // List View Page: Upcoming Events
$title = ‘Upcoming Events – Danish Maritime Days’;
}
elseif ( tribe_is_map() && !is_tax() ) { // Map View Page
$title = ‘Upcoming Events – Danish Maritime Days’;
}
return $title;
}April 3, 2014 at 7:25 am #127418Barry
MemberSo to add the yellow block (a code block) you just need to add appropriate HTML in your reply:
<code> ...your code here </code>However, don’t depend on it as there are a number of quirks we are working through with the forum – so results may be unexpected and we’d still generally recommend sharing code via Pastebin/Gist/some similar service.
Changing add_filter(‘wpseo_title’, ‘filter_events_title’); to add_filter(‘wp_title’, ‘filter_events_title’); like shown below make “Map View” custom title show but then “Week View” and “List View” custom title doesn’t show !!! How do you explain that – unless something has been changed with 3.5?
Hmm, it’s definitely puzzling: what I can say, though, is this works for me (I’m not testing with WP SEO enabled however). On map view the title is prefixed with Upcoming Events – Danish Maritime Days, on list view I see the same, and on week view I see Events – Danish Maritime Days.
I’d love to help further but, ultimately, what you’re working through here is a customization – I can’t actually see the problem and perhaps it’s specific to your environment? I’d definitely recommend maintaining a testing installation where you can easily collapse down to just our plugins and a default theme to help isolate if this is caused by some other component.
Beyond that I’m afraid we can’t assist further on this one and will close the thread – I do hope you find the solution, though.
-
AuthorPosts
- The topic ‘SEO title error since 3.5’ is closed to new replies.
