List view – adding a class to the month tribe-events-list-separator-month span

Home Forums Calendar Products Events Calendar PRO List view – adding a class to the month tribe-events-list-separator-month span

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #524333
    Nathan
    Participant

    Hi 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!

    #527749
    Casey D
    Member

    Hello 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

    #587988
    Nathan
    Participant

    Ah! 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.

    #640087
    Casey D
    Member

    Hello 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

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘List view – adding a class to the month tribe-events-list-separator-month span’ is closed to new replies.