Forum Replies Created
-
AuthorPosts
-
September 25, 2018 at 8:38 am in reply to: tribe_get_custom_field – Depreciated need alternate. #1630085
Ken Charity
ParticipantThat didn’t help. Much easier to just use
strip_tags( $myvariable)My Solution:
<?php //Custom fields $fields = tribe_get_custom_fields(); $register_cf = $fields['Register']; // Event Registration if ( ! empty( $register_cf ) ) : ?> <div class="mec-event-more-info"> <i class="mec-sl-info"></i> <dt><?php esc_html_e( 'Registration:', 'the-events-calendar' ) ?></dt> <dd class="tribe-events-event-url"><a href="<?php echo strip_tags( $register_cf );?>" class="x-btn x-btn-large">Register Online</a></dd> </div> <?php endif ?>September 19, 2018 at 4:16 pm in reply to: tribe_get_custom_field – Depreciated need alternate. #1625919Ken Charity
ParticipantAfter some experimenting, I have updated my code to:
//Custom fields $fields = tribe_get_custom_fields(); $register_cf = $fields['Register'];This gets the $register_cf to have the content of the field, but is wrapping it automatically in
<a>tag so that I cannot correctly format it and have the classes I want. So then do I have to strip the string of its tags so I can insert it the way I want?June 4, 2018 at 7:20 am in reply to: Output of do_action( 'tribe_events_single_event_meta_primary_section_end' ) #1545475Ken Charity
ParticipantThanks for the snippet, I think that should solve the issue without further modification of the meta.php file. I appreciate the forward thinking of still being able to use the action by hooking into it.
May 31, 2018 at 3:21 pm in reply to: Output of do_action( 'tribe_events_single_event_meta_primary_section_end' ) #1543401Ken Charity
ParticipantI have modified my
single-event.phpto have a sidebar and in the sidebar themeta.phpfile is called. But I have adjusted thechild-theme/tribe-events/modules/meta/details.phpfile to include the additional fields in the location I want by calling the functiontribe_get_custom_field( 'My Field' );instead of the end where the template files place it.So now I have the additional field in the location where I want it. But it also appears at the end of the sidebar where it does by default. Your answer kind of helps me though.
You are saying that all that
do_action( 'tribe_events_single_event_meta_primary_section_end' )does is loop through the additional fields and then output the additional fields? If that is the case I can just remove it from themeta.phpfile and I should be good. If I need to add in more additional fields I will either need to add the line back in and format the output or addtribe_get_custom_field( 'Another My Field' );to thedetails.phpfile.December 15, 2017 at 11:48 am in reply to: Move Related Events from appearing after meta to after content #1406669Ken Charity
ParticipantThat is the best canned answer I have heard all day. If you really dont know the answer that is ok too. You think I have the time to wait 48 hours for a reply and had not already searched for an answer? And not all of us need a developer, some of us are developers needing a point in the right direction. And to be honest the search features on this website are some of the worst I have come across. I can hardly ever find what I need by using search here.
My guess is that this code simply doesn’t work anymore:
remove_action( 'tribe_events_single_event_after_the_meta', 'tribe_single_related_events' );Luckily there is a setting in for the Pro version that turns off the related events. It’s on the display tab under “Basic Template Settings”. I have attached a screen shot for you. So luckily, I guess I don’t need that code above.
So now my code that can place the related images were I need it can be used:
if ( function_exists( 'tribe_single_related_events' ) ) { add_action( 'tribe_events_single_event_after_the_content', 'tribe_single_related_events' ); }December 5, 2017 at 8:14 am in reply to: Featured Event, Featured Image don't appear in tooltip #1398645Ken Charity
ParticipantHi Victor,
Yes I see that the
<h4 class="entry-title summary">tag had a property ofposition:relativesince it had the classentry-titledefined in my CSS.I have added your selector and it seems to solve the problem. Thanks for helping diagnose and fix the issue.
December 4, 2017 at 7:56 am in reply to: Featured Event, Featured Image don't appear in tooltip #1397815Ken Charity
ParticipantThis reply is private.
December 1, 2017 at 8:57 am in reply to: Featured Event, Featured Image don't appear in tooltip #1396728Ken Charity
ParticipantThe issue occurs with the display setting set to “Full Styles” for the stylesheet. It shows as normal “like the demo” when set to “Tribe Event Styles”.
August 18, 2017 at 4:45 pm in reply to: To create a new list widget or not that is the question. #1337605Ken Charity
ParticipantHi Jennifer,
I see how you could have thought that I created pages based off my initial thread. No I didn’t create actual pages in WordPress. I understand how TEC works in that sense, sorry for the confusion.
I get what you mean about using conditionals with the widget template. That may be the way to go. I appreciate your efforts.
Thanks
KenAugust 5, 2017 at 8:16 am in reply to: To create a new list widget or not that is the question. #1331173Ken Charity
ParticipantThis reply is private.
Ken Charity
ParticipantThis is just tripping me up still.
So I have this in the Functions file:
add_filter( 'tribe_event_featured_image', 'custom_event_featured_image', 10, 3 ); function custom_event_featured_image( $featured_image, $post_id, $size ) { $link = true; $image_html = get_the_post_thumbnail( $post_id, apply_filters( 'tribe_event_featured_image_size', $size, $post_id ) ); if ( ! empty( $image_html ) && apply_filters( 'tribe_event_featured_image_link', $link ) ) { $featured_image .= '<div class="event-image"><a href="' . esc_url( tribe_get_event_link() ) . '">' . $image_html . '</a></div>'; } elseif ( ! empty( $image_html ) ) { $featured_image .= '<div class="event-image">' . $image_html . '</div>'; } return $featured_image; }And this in the single-event file:
<!-- Event featured image, but exclude link --> <?php echo tribe_event_featured_image( $event_id, 'full', false ); ?>But now I am getting 2 images one with no link, and one below it with my new HTML in it but it is also linked. So why two images now, and why is it now linked?
Ken Charity
ParticipantHi Josh
Thanks for that starter code! So I added that to my function.php file and then in my single-event.php file I added in this
<div class="entry-featured"> <div class="entry-thumb"> <!-- Event featured image, but exclude link --> <?php echo custom_event_featured_image( $event_id, 'full', false ); ?> </div> </div>But no image is output on that page now. The last bit that is there is the comment abut the image.
Ken Charity
ParticipantThanks for the info.
Ken Charity
ParticipantAh ok thanks for clarifying that. That would be similar to the second code snippet I wrote minus the check. I assume that Venues and Organizers can also fall in that tribe_is_event() check as well?
I was really trying to use tribe_is_event() as a wrapper for all ECP related pages. Is there such a helper function that exists?
June 27, 2015 at 11:05 am in reply to: X-theme + ECP integration issues (no title/breadcrumbs) #973343Ken Charity
ParticipantThanks Brian that helps, I also think there was an issue with Yoast SEO I stumbled across another thread with that and am getting closer to sorting that out.
I am trying to keep my posts more general now and related to TEC:
So I was experimenting with categories (some with events and some without.
When I have this:
} elseif ( tribe_is_event() ) { if ( is_singular( 'tribe_events' ) ) { echo $current_before . '<a href="' . tribe_get_events_link() . '">Events</a>' . $delimiter . $page_title . $current_after; // we are on a single event page } elseif ( tribe_is_month() && !is_tax() ) { // Month View Page echo $current_before . __( 'Events Calendar', 'ehs' ) . $current_after; } elseif ( tribe_is_month() && is_tax() ) { // Month View Category Page echo $current_before . __( 'Events Calendar Category', 'ehs' ) . $current_after; } } elseif ( is_archive() ) { echo $current_before . __( 'Archives ', '__x__' ) . $current_after; }On category with events I get ‘Events Calendar Category’ output with no events I get ‘Archives’
But with if I remove the
tribe_is_event()function from around the other if/then and have it as:} elseif ( is_singular( 'tribe_events' ) ) { echo $current_before . '<a href="' . tribe_get_events_link() . '">Events</a>' . $delimiter . $page_title . $current_after; // we are on a single event page } elseif ( tribe_is_month() && !is_tax() ) { // Month View Page echo $current_before . __( 'Events Calendar', 'ehs' ) . $current_after; } elseif ( tribe_is_month() && is_tax() ) { // Month View Category Page echo $current_before . __( 'Events Calendar Category', 'ehs' ) . $current_after;The output is the same for both categories with and without events associated. Why would this be? Is the check
tribe_is_event()not working if no event is tied to a category? -
AuthorPosts
