duplicate page titles showing

Home Forums Calendar Products Events Calendar PRO duplicate page titles showing

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1029772
    Brett Johnson
    Participant

    In the process of updating the events calendar/PRO plugin. On my machine (localhost) I see DUPLICATE page titles (wp_title). Any ideas why this can be occurring? What I see now as page title, EXAMPLE: Upcoming Events | Events | Torpedo Factory Art Center. What it should be: Upcoming Events | Torpedo Factory Art Center

    Please see screenshot at:

    View post on imgur.com

    Thanks

    #1029797
    George
    Participant

    Hey @Alyssa,

    Thanks for reaching out!

    I have some good and bad news here.

    The bad news is that I unfortunately do not know why this is happening – I can’t quite recreate this exact issue on my local testing site. Your theme’s own wp_title() filters might be the problem here.

    However, the good news is that you can just override this manually – it will only affect the title on The Events Calendar pages too!

    To override this, you would add code like the following to your theme’s functions.php file:


    add_filter( 'tribe_events_title_tag', 'tribe_1029772', 10, 3 );

    function tribe_1029772( $new_title, $the_title, $sep ) {
    return 'Upcoming Events | Torpedo Factory Art Center';
    }

    If you want to get more detailed with that, you can combine the above code snippet with the Conditional tags listed here, for example → https://gist.github.com/jo-snips/2415009

    So, for example, if you want the title to be “Upcoming Events This Month” on month view, but “Upcoming Events This Week” on week view, something like this should work well:


    add_filter( 'tribe_events_title_tag', 'tribe_1029772', 10, 3 );

    function tribe_1029772( $new_title, $the_title, $sep ) {

    if ( tribe_is_month() && ! is_tax() ) {
    $new_title = 'Upcoming Events This Month | Torpedo Factory Art Center';
    }

    if ( tribe_is_week() && !is_tax() ) {
    $new_title = 'Upcoming Events This Week | Torpedo Factory Art Center';
    }

    return $new_title;
    }

    I hope this helps!

    Cheers,
    George

    #1030887
    Brett Johnson
    Participant

    Thank you! That was very helpful and you were correct my Theme was also manipulating wp_title(). So I hooked on to your filters and changed the title accordingly for Events only.

    #1032228
    George
    Participant

    Awesome – glad to hear this snippet helped. Be sure to backup any custom code like this, or bookmark this thread for future reference or something like that (just so that it’s easy to replace the code in the event that, if you auto-update your theme, this code gets overwritten).

    Cheers!
    George

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘duplicate page titles showing’ is closed to new replies.