Forum Replies Created
-
AuthorPosts
-
Nathan
ParticipantOK… so the sort order is called event_date. Makes sense, but I couldn’t find it on the documentation.
Will use paste bin in future, thanks.
August 5, 2014 at 7:50 am in reply to: List view – adding a class to the month tribe-events-list-separator-month span #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.Nathan
ParticipantHi Barry, I’ve deliberately omitted the link as it is a client’s live site and I don’t want to put it publicly on a forum.
Nathan
Participantis this working?
Nathan
ParticipantThis reply is private.
Nathan
ParticipantThis reply is private.
Nathan
Participantok thanks for that.
There definitely isn’t a typo as if i put in the id of a conference event, it works, and if I change the filter to be ‘post-class’ that works, so I’ll just try see what is causing it not to get the post id at that point.
I’m trying to use the conditionals in the same way as wp conditionals which do work. (is_singular() works but tribe_is_event() doesn’t in the same body_class filter function.
I’ll just have to see if it is conflicting with something else.Nathan
ParticipantAs an alternative i tried using the conditionals listed on
https://gist.github.com/jo-snips/2415009
I can’t get these to work in the functions file (whereas wp conditionals do), though they work fine on actual template files.Nathan
Participanti did say in the first message it was in the functions file.
as far as i can see, $post->ID does not return anything for single events.
i have used the following function which puts the page/post id into the body css for all posts other than tribe events:
add_filter(‘body_class’,’conf_class’);
function conf_class($classes) {
global $post;
$classes[] = $post->ID;
return $classes;
}Nathan
ParticipantHi
This is in the functions file, not in the loop. Other functions seem able to get the post ID using the same filter in my functions file.
this function works perfectly:
function category_id_class($classes) {
global $post;
foreach((get_the_category($post->ID)) as $category)
$classes[] = $category->category_nicename;
return $classes;
}
add_filter(‘body_class’, ‘category_id_class’);The body already has a class with the tribe event ID, so it must be available when wordpress is writing the body classes.
-
AuthorPosts
