Title tag for single events

Home Forums Calendar Products Events Calendar PRO Title tag for single events

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1012521
    Myrna Ougland
    Participant

    Hi, I’ve had a bit of a trial allowing custom title tags for various pages in my site, including some custom post types. Finally got everything working and got the Calendar page to show a title tag as well, but I cannot get the single events pages to show title tags. I tried the global wp-config fix but that did not work, maybe because of my custom code. Is there a way I can target the single events pages in a similar fashion to what I’ve done below:

    <title> <?php $title= get_post_meta($post->ID, 'Title', true); ?>
    		<?php if( is_single() ) echo $title;
       			elseif( is_page() ) echo $title;
    			elseif( is_page('calendar') ) echo $title;
    			else wp_title(''); ?> | <?php bloginfo('name'); ?></title>

    Right now all I get for my title tag is ” | Island Gateway” (the website name). I did notice on another site that is running Events Calendar — done by a different local organization — they are having the same issue.

    I did try reverting to the WordPress default 2014 theme and that did give me “Upcoming Events | Event TItle | Site Name” in the title tag — even though the event I checked was a “past” event. Any assistance would be greatly appreciated, thanks!

    #1012697
    Brian
    Member

    Hi,

    Thanks for using our plugins. I can help out here.

    There are a couple different options for the single events one of these might work:

    tribe_is_event() && is_single()

    is_singular('tribe_events')

    Do either of those work for you?

    And for future reference I have this list of conditionals that might help you:

    https://gist.github.com/jo-snips/2415009

    #1012792
    Myrna Ougland
    Participant

    Hi Brian, Thanks so much, the list of conditionals will be really helpful. So the problem turned out to be at my end — I didn’t have anything assigned to $title on the events pages. I solved the problem using Advanced Custom Fields and adding a “Title” field to the edit event page — an extra step, but it does work. Thanks again, everyone at Modern Tribe has been quick to respond to my many questions!

    #1012852
    Brian
    Member

    Great! I am glad to see you were able to figure it out.

    I am going to go ahead and close this ticket. If you have a similar issue or another in the future, please do not hesitate to create a new ticket.

    Thanks!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Title tag for single events’ is closed to new replies.