• Truth Seeker
    Posts: 18
    Topics: 9
    Answers: 1
    Jon September 10, 2012

    Hi Guys,
    We’re having a similar problem to a number of other posters on the forum with the page titles. At the moment we have no page title set at all for any of the events pages (we only use upcoming, past & calendar).

    I saw this and tried the same fix: http://tri.be/support/forums/topic/editing-page-titles-when-using-wordpress-seo-plugin/

    It’s not working for me though. The filter is definitely being called as I can insert a die; statement and the script dies as expected. Here’s what I’m using:

    function eddytm_modify_past_events_title( $title, $separator ) {
    $new_title = ‘Upcoming Events’;
    return $new_title;
    }
    add_filter(‘tribe_past_events_title’, ‘eddytm_modify_past_events_title’, 10, 3);

    function eddytm_modify_upcoming_events_title( $title, $separator ) {
    $new_title = ‘Some Events’;
    return $new_title;
    }
    add_filter(‘tribe_upcoming_events_title’, ‘eddytm_modify_upcoming_events_title’, 10, 3);

    Any ideas?

  • Power User
    Posts: 4021
    Topics: 4
    Answers: 763
    Jonah September 10, 2012

    Hi Jon,

    The first thing you should check is your code syntax. Your fancy single quotes above will not work – you need to use regular single quotes. I corrected this and popped the code in my functions.php file and it works for me. And just to confirm you are trying to change the HTML title tag titles and not the page title that appears on the page at the top of events correct?

    Please verify your code and confirm what you’re trying to change.

    Thanks,
    Jonah

  • Truth Seeker
    Posts: 18
    Topics: 9
    Answers: 1
    Jon September 11, 2012

    HI Jonah,
    Thanks for getting back to me. The fancy quotes are only an issue because I’ve copied from my development environment into the comment reply box here. They’re fine in my source but to make sure we’re totally clear, I’ve put them here: http://pastebin.com/P66sGWLc

    And to confirm: yes, I’m trying to change the tag.

    Cheers.

  • Power User
    Posts: 4021
    Topics: 4
    Answers: 763
    Jonah September 11, 2012

    Hi Jon,

    That code should work then. Maybe it’s your theme. Have you tried reverting to Twenty Eleven to see if the code works there?

    Thanks,
    Jonah

  • Truth Seeker
    Posts: 18
    Topics: 9
    Answers: 1
    Jon September 11, 2012

    I hadn’t, but I’ve just tried it and it made no difference I’m afraid.

  • Power User
    Posts: 4021
    Topics: 4
    Answers: 763
    Jonah September 11, 2012

    Hi Jon,

    Ok, can you send us a copy of your theme? Please email to pro [at] tri [dot] be and reference this thread and attention it to me. I’ll take a look and see what else I can find.

    Thanks,
    Jonah

  • Truth Seeker
    Posts: 18
    Topics: 9
    Answers: 1
    Jon September 11, 2012

    All done. Thanks Jonah!

  • Power User
    Posts: 4021
    Topics: 4
    Answers: 763
    Jonah September 12, 2012
    Answered ✔

    Hi Jon,

    I think I figured it out. If you are using WP SEO, you will not be able to use our filters to modify the titles, you need to use the WP SEO filter for ‘wpseo_title’ instead. Here is an example: https://gist.github.com/3710617

    You can combine this with the conditional wrappers here to modify the titles for all the event plugin related pages: https://gist.github.com/2415009

    Oh, and since your jagermaster themes header.php calls the wp_title plus the bloginfo(‘name’), you’ll want to remove the bloginfo part because ‘wpseo_title’ only filters wp_title.

    I hope that helps but let me know if you need anything else!

    Cheers,
    Jonah

  • Truth Seeker
    Posts: 18
    Topics: 9
    Answers: 1
    Jon September 13, 2012

    Hey Jonah,

    That worked perfectly! Interestingly, and I assume it’s because of Yoast SEO, I still needed to call get_bloginfo(‘name’) in the filters, even though it’s still being called in header.php.

    Here’s the code I used in the end: https://gist.github.com/3712948

    Note for anyone else reading, there’s lots of redundancy in this code as I haven’t fixed the page titles yet, but if you are only using a couple of different page titles then you can cut down the number of elseif conditions.

    The only thing I haven’t been able to do with the conditional wrappers you provided was past events. I’m not actually too worried about that in this case, but it’d be useful to understand for the future.

    Thanks for all your help!

  • Power User
    Posts: 4021
    Topics: 4
    Answers: 763
    Jonah September 13, 2012

    Hey Jon,

    The code looks good and I’m glad you worked this out. To check for whether you are viewing past events or not you should be able to use:

    tribe_is_past();

    Cheers,
    Jonah

  • Truth Seeker
    Posts: 18
    Topics: 9
    Answers: 1
    Jon September 13, 2012

    That worked perfectly. There is one issue with my code and that’s that the else statement sets ALL titles except for the ECP titles to be Events | Blogname. So I’ve removed that and it’s working fine.

    Thanks for all your help.

  • Truth Seeker
    Posts: 22
    Topics: 5
    Ray September 26, 2012

    here’s my take on TEC & WPSEO titles – I’ve added a custom taxonomy – tags – to tribe_events, so needed to separate that out to – http://pastebin.com/VVXMVn7M

  • Power User
    Posts: 4021
    Topics: 4
    Answers: 763
    Jonah September 26, 2012

    That’s awesome Ray! Thanks for the contribution!

    - Jonah

  • Truth Seeker
    Posts: 22
    Topics: 5
    Ray September 26, 2012

    well, it might have one or two small errors.. I’m still testing it – I also use a simple get event cat function ( http://pastebin.com/bzaSe984 ) which I was using to get the category – perhaps better to be using your own class – which I tried in the SEO title function…

  • Viewing 14 posts - 1 through 14 (of 14 total)