Home › Forums › Calendar Products › Events Calendar PRO › List view – adding a class to the month tribe-events-list-separator-month span
- This topic has 3 replies, 2 voices, and was last updated 12 years ago by
Casey D.
-
AuthorPosts
-
July 28, 2014 at 3:57 am #524333
Nathan
ParticipantHi there,
I’m trying to add a class to the month title in list view. I have found the <?php tribe_events_list_the_date_headers(); ?> in list/loop.php.
I don’t quite understand where or how I change this function as I can’t find a template for it.I’m aware that this could be seen as a customisation request outside of the scope of support, but perhaps if I rephrase the question – I have tried to understand where the functions are kept (they used to be in a functions file – much like a theme in the older TEC…).
I did a search and found: http://docs.tri.be/Events-Calendar/function-tribe_events_list_the_date_headers.html I’m aware that the function is tantalisingly in public/template-tags/loop.php
But this doesn’t describe how to customise this… and obviously I know better than to edit directly in the plugin 🙂So basically I can’t understand how to hook into tribe_events_list_show_date_headers, or remove it and add my own custom version from my themes functions.php. IF you are able to help, or give me pointers, that’d be great!
July 28, 2014 at 1:42 pm #527749Casey D
MemberHello blitz,
This was a bit of a learning experience for me to0, but I think I grasped it!
You don’t want the first filter ‘tribe_events_list_show_date_headers’, that is just a boolean to control whether you want the headers to show at all. It sounds like you want them, with an added class
‘apply_filters’ will return any hooked filter result, using the function add_filter(). Then you just search the content you want and improve it.
This is basically what you are looking for:
http://gist.github.com/caseypatrickdriscoll/671e23ca99cc61b98e82
Does this make sense? Let me know if this doesn’t work for you.
Cheers!
– Casey Driscoll
August 5, 2014 at 7:50 am #587988Nathan
ParticipantAh! You nailed it, thank you!
I was trying to remove tribe_events_list_the_date_headers, then adding a custom version – which did seem a clunky approach. Your code concatenates the existing filter, much more elegant – I learned something today 🙂
Thanks again for taking the time to look at this.August 11, 2014 at 9:49 am #640087Casey D
MemberHello blitz,
Happy it worked out!
We’d love it if you would leave us a review and let people know how much you like the plugin! http://m.tri.be/jt
I’ll go ahead and close this thread. Let us know if we can help with anything else.
– Casey Driscoll
-
AuthorPosts
- The topic ‘List view – adding a class to the month tribe-events-list-separator-month span’ is closed to new replies.
