Home › Forums › Calendar Products › Events Calendar PRO › Browser Page Title Error
- This topic has 6 replies, 2 voices, and was last updated 11 years, 1 month ago by
Brian.
-
AuthorPosts
-
February 26, 2015 at 12:34 pm #945044
clarksburgbaptist
ParticipantHello,
I am receiving an odd warning in the Browser Page Title for my events calendar page. The page title is displaying the follwing:
<br /> <b>Warning</b>/ strpos()/ Empty needle in <b>/home/cbcadmin501/public_html/wp-content/themes/Marine/functions.php</b> on line <b>1487</b><br /> Events | Clarksburg Baptist Church
This isn’t happening on any other pages, just the events page.
What is causing the issue and how can it be corrected? Thanks so much for your help!
Thanks,
AndyFebruary 26, 2015 at 12:38 pm #945053Brian
MemberHi,
Sorry for the issues you are having.
Looks in your theme there is a function running on line 1487 of the functions.php and the variable is empty on event pages causing the issue.
if you can add a isset check on the variables before this function: strpos
That should prevent the warning from happening.
Let me know if you have any follow up questions.
Thanks
February 26, 2015 at 12:40 pm #945054clarksburgbaptist
ParticipantHi Brian,
Thanks so much for the quick response! What is an “isset check” on a variable? How exactly would this look?
Sorry for being a little out of my depth on this one. Not super familiar with PHP.
Thanks,
AndyFebruary 26, 2015 at 12:44 pm #945058clarksburgbaptist
ParticipantFor reference, here is the line(s) of code in question. This snippet was added based on MT Support recommendation back on this topic.
function events_title_tag( $title, $separator ) { return substr_replace( $title, 'Calendar ', 0, strpos( $title, $separator) ); }Thanks,
AndyMarch 4, 2015 at 11:02 am #945964Brian
MemberSorry for the late reply.
Are you using the entire snippet including adding both add filters?
If so try this instead:
add_filter( 'tribe_month_grid_view_title', 'events_title_tag', 10, 2 );
add_filter( 'tribe_events_this_month_title', 'events_title_tag', 10, 2 );function events_title_tag( $title, $separator ) {
if ($title && $separator) {
return substr_replace( $title, 'Calendar ', 0, strpos( $title, $separator) );
}return $title;
}Let me know if that stops the error.
Thanks
March 5, 2015 at 8:32 am #946185clarksburgbaptist
ParticipantHi Brian,
Yes – I am using the entire snippet. Sorry for leaving that off previously.
I updated to your new code and it seems to have fixed the issue.
Thanks for your help!
– Andy
March 5, 2015 at 10:48 am #946236Brian
MemberThats cool about snippet, glad it helps, I am going to go ahead and close this ticket, but if you need help on this or something else please post a new ticket.
Thanks!
-
AuthorPosts
- The topic ‘Browser Page Title Error’ is closed to new replies.
