Home › Forums › Calendar Products › Events Calendar PRO › Control "title" tags in wp_head for tribe events
- This topic has 5 replies, 4 voices, and was last updated 10 years, 9 months ago by
Support Droid.
-
AuthorPosts
-
August 28, 2013 at 7:51 pm #63545
evossman
ParticipantI want to control the “title” tag in the “head” section and haven’t been able to figure out a good way to do it. I’m using a genesis theme (news) and tried using a few SEO plugins to no avail (Yoast, Ultimate, etc). I also tried a filter in the functions file on wp_head and then using the “tribe_is….” functions to create and if/else statement as shown https://gist.github.com/jo-snips/2415009/raw/87d950358ae745d3b4bac6158fc6ef047e50aa35/events-conditional-wrappers.php
That works, but filters all other pages incorrectly. Meaning that now the homepage reads the same as the “tribe_is_month” and the category and tag pages read according to some other combination in the conditional. I also tried adding in “is_home”, is_category, is_tag, etc to overide, but that wouldn’t work because depending on where it is in the elseif order, one overrides the other and i’ll have mixedup tags. I read somewhere that because of when the tribe plugin is called some of those conditional wrappers would work and some wouldn’t.
I’m assuming since this is such a common thing that I’m missing something.
Any help is greatly appreciated.
August 29, 2013 at 5:32 pm #63752evossman
ParticipantOkay, it seems like the solution is similar to my troubles with genesis and full-width. You need to detect the post type prior to making any changes. Prior to the if conditional logic above I put if(get_post_type() == ‘tribe_events’ || get_post_type() == ‘tribe_venue’ || get_post_type() == ‘tribe_organizer’){
I tried this with Yoast SEO which didn’t work but SEO Ultimate lets you disable the title rewrites. All was well. I’m sure yoast seo has a hook or filter or something to turn it off or to filter and you can do the same thing as described above. Full code here https://gist.github.com/evossman/6385046
September 3, 2013 at 10:07 am #64283Rob
MemberThanks for your follow-up, evossman, and for confirming that you were able to get yourself sorted here. Am I correct in assuming that you don’t need anything more (and that the thread can be closed as a result)? Let me know!
September 13, 2013 at 11:03 am #65817evossman
ParticipantRob, that is correct.
CheersSeptember 18, 2013 at 3:26 pm #66711Barry
MemberThanks evossman!
July 7, 2015 at 6:27 am #980859Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Control "title" tags in wp_head for tribe events’ is closed to new replies.
