Browser Page Title Error

Home Forums Calendar Products Events Calendar PRO Browser Page Title Error

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #945044
    clarksburgbaptist
    Participant

    Hello,

    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,
    Andy

    #945053
    Brian
    Member

    Hi,

    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

    #945054
    clarksburgbaptist
    Participant

    Hi 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,
    Andy

    #945058
    clarksburgbaptist
    Participant

    For 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,
    Andy

    #945964
    Brian
    Member

    Sorry 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

    #946185
    clarksburgbaptist
    Participant

    Hi 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

    #946236
    Brian
    Member

    Thats 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!

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Browser Page Title Error’ is closed to new replies.