Forum Replies Created
-
AuthorPosts
-
Heinz DuschanekParticipant
Deactivating WPML fixes (fixes???) the error.
Uhm, this can’t be true … Should we switch to polylang other than WPML?
OMG!
Heinz DuschanekParticipantFor other users searching here: another solution to get the category slug into the body CSS classes for a single event (to be used in functions.php):
add_filter('body_class','conf_class'); function conf_class($classes) { if(in_the_loop()) { $post_id = get_the_ID(); } else { $post_id = get_queried_object_id(); } $terms = tribe_get_event_cat_slugs($post_id); foreach ($terms as $term) { // loop needed? $eventCatSlug = $eventCatSlug . 'tribe_events-category-' . $term; } $classes[] = $eventCatSlug; return $classes; }
Maybe the foreach loop is not needed, as it also works with:
$classes[] = 'tribe_events-category-' . $terms[0];
Now I try to figure out the same thing for category archive pages. Wish me luck.
Heinz DuschanekParticipantHi Shelby,
thank you for your answer, but I think this is a misunderstanding.
First: I do not need external PHP freelancer help, I can tweak code by myself.
Second: I am just asking (as so many others here also did) how to get the slug of a tribe category within a function in functions.php. This is not an unsolvable mystery, I guess, so why not provide a working code snippet to me and the others?The themers guide the support team refers to is wonderful, but no help here.
The category slug is a already there, as I can see it within <body> in a <div>-tag. All I ask is for some lines of code to put it into the <body>-tag additionally, as we need it for styling purposes.
Heinz DuschanekParticipantI am a little bit astonished that there is no way to set this. But yes, in that case I am interested in your resources … but where do I find something about prev/next in the themer’s guide?
Thank you in advance.
Heinz DuschanekParticipantI figured out this here, which at least adds the tribe category to the body CSS in case of single events:
add_filter('body_class','category_id_class'); function category_id_class($classes) { if(in_the_loop()) { $post_id = get_the_ID(); } else { $post_id = get_queried_object_id(); } $eventCatSlug = ''; $terms = wp_get_post_terms($post_id, 'tribe_events_cat'); $count = count($terms); if ( $count > 0 ){ foreach ( $terms as $term ) { $eventCatSlug = $eventCatSlug . ' tribe-events-category-' . $term->slug; } } $classes[] = $eventCatSlug; return $classes; }
Uhm, tribe team, are you serious by not providing something easier to get the category slug in functions.php???
How would I get the same result for a category of events instead of the single event? It is just not sufficient to have it later in a <div>…
Heinz DuschanekParticipantSOLVED: Chrome keeps cache rigidly, other browsers shows right behaviour.
Heinz DuschanekParticipantI mean this code:
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');
Heinz DuschanekParticipantThe customer bought the two plugins now, and I really hope, there will be no showstopper here ….
Regards,
HeinzHeinz DuschanekParticipantGreat, I think we suggest it to the customer then ….
Thank you for your help so far.
Heinz DuschanekParticipantSo far it looks as if this can be done with your plugins.
Yet two more issues:
* Is it possible to get a demo version of event tickets plus, which works for e.g. two weeks on a staging server just to be able to create a working demo site for the customer (layout does not matter, it’s about the functionality)? Or is there already a demo site showing these features?
* Concerning trainers: is it possible to display a picture of the trainer within the course (e.g. using a widget in sidebar)? Maybe by setting the name or id of the trainer as a <body> css class, to be able to do this with CSS? Or by using a post thumbnail/featured image, which can then be display along with the name of the organizer/trainer (by using a custom template)?
Heinz DuschanekParticipantThank you, Geoff,
we think about your suggestions.
Kind regards,
HeinzHeinz DuschanekParticipantLast question so far:
a registration for events with payment gateway API is there? Or would the registration process need to be done entirely externally?
Thank you in advance,
HeinzHeinz DuschanekParticipantHi Shelby,
thank you. By “plugin customization” you mean work in template files? Because that should not be overwritten with future plugin updates.
Heinz
Heinz DuschanekParticipantI think I was successful, please confirm.
New code in the top part of /tribe-events/list/single-event.php:
<?php // Setup an array of venue details for use later in the template $venue_details = tribe_get_venue_details(); // Venue $has_venue_address = ( ! empty( $venue_details['address'] ) ) ? ' location' : ''; // Organizer $organizer = tribe_get_organizer(); if ($venue_name = tribe_get_meta( 'tribe_event_venue_name' ) ) { $venue_details[] = $venue_name; } if ($venue_address = tribe_get_meta( 'tribe_event_venue_address' ) ) { $venue_details[] = $venue_address; } ?>
And then display it with:
<?php echo $venue_name . '<br />' . $venue_address; ?>
I hope this change does not provide trouble in the future.
Heinz DuschanekParticipantI could identify the file: /tribe-events/list/single-event.php
It contains:
<?php tribe_get_venue_link( get_the_ID(), class_exists( 'TribeEventsPro' ) ); ?>
Or in full:
<?php if( class_exists( 'TribeEventsPro' ) ): ?> <span class="datum-none"><?php tribe_get_venue_link( get_the_ID(), class_exists( 'TribeEventsPro' ) ); ?></span><br /> <?php else: ?> <span class="datum-none"><?php echo tribe_get_venue( get_the_ID() ); ?></span> <?php endif; ?> </span>
And this does not work anymore.
-
AuthorPosts