Home › Forums › Calendar Products › Events Calendar PRO › Modify tribe_get_events_title()
- This topic has 3 replies, 1 voice, and was last updated 9 years ago by
bruce williams.
-
AuthorPosts
-
March 13, 2017 at 7:10 pm #1253642
bruce williams
ParticipantI’m using a web font that doesn’t have the rsaquo entity which is used in the tribe_get_evens_title() function to separate the “Upcoming Events” label from the event category name when listing events by category. Is it possible to override and/or modify this function to use a different format for the event category listing title?
Thanks!
March 14, 2017 at 4:12 pm #1254127George
ParticipantHey Bruce,
Unfortunately the only way to tweak this character is to write custom code. We don’t technically offer any help for custom coding, but I was happy to take a look at this nonetheless and see what I could come up with ?
Unfortunately, this one tribe_get_events_title() is used for generating a lot of events titles across a number of views. So to ensure that the modifying of the category title happens without altering the look or behavior of any other titles, I actually just duplicated much of the original code of the function.
But you can change one line of the code to modify the category title’s character.
First, here’s the full snippet I wrote for you ? https://git.io/vyMq4
Copy that whole snippet and paste it into your theme’s functions.php file.
Once that’s pasted in there, note this section of the code near the bottom of the snippet:
/**
* Modify this character to modify the category title separator.
*
* @see http://m.tri.be/19mj
*/
$title .= ' → ' . $cat->name;
☝️ I’ve changed the default rsaquo character to the → character as an example, bu you can tweak it to use any other character you want.
Or you can just modify the code even more extensively to wholly modify the output of the category title.
You will have to take the reins on implementing and tinkering with this custom snippet, but I hope it helps!
Cheers,
GeorgeApril 5, 2017 at 9:35 am #1265127Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Modify tribe_get_events_title()’ is closed to new replies.
