Home › Forums › Calendar Products › Events Calendar PRO › Title tag for single events
- This topic has 3 replies, 2 voices, and was last updated 10 years, 7 months ago by
Brian.
-
AuthorPosts
-
October 7, 2015 at 2:59 pm #1012521
Myrna Ougland
ParticipantHi, 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!
October 8, 2015 at 7:28 am #1012697Brian
MemberHi,
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:
October 8, 2015 at 11:46 am #1012792Myrna Ougland
ParticipantHi 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!
October 8, 2015 at 2:14 pm #1012852Brian
MemberGreat! 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!
-
AuthorPosts
- The topic ‘Title tag for single events’ is closed to new replies.
