Ken Charity

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 31 total)
  • Author
    Posts
  • in reply to: tribe_get_custom_field – Depreciated need alternate. #1630085
    Ken Charity
    Participant

    That 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 ?>
    in reply to: tribe_get_custom_field – Depreciated need alternate. #1625919
    Ken Charity
    Participant

    After 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?

    Ken Charity
    Participant

    Thanks 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.

    Ken Charity
    Participant

    I have modified my single-event.php to have a sidebar and in the sidebar the meta.php file is called. But I have adjusted the child-theme/tribe-events/modules/meta/details.php file to include the additional fields in the location I want by calling the function tribe_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 the meta.php file 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 add tribe_get_custom_field( 'Another My Field' ); to the details.php file.

    Ken Charity
    Participant

    @jaime

    That 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' );
    }
    in reply to: Featured Event, Featured Image don't appear in tooltip #1398645
    Ken Charity
    Participant

    Hi Victor,

    Yes I see that the <h4 class="entry-title summary"> tag had a property of position:relative since it had the class entry-title defined in my CSS.

    I have added your selector and it seems to solve the problem. Thanks for helping diagnose and fix the issue.

    in reply to: Featured Event, Featured Image don't appear in tooltip #1397815
    Ken Charity
    Participant

    This reply is private.

    in reply to: Featured Event, Featured Image don't appear in tooltip #1396728
    Ken Charity
    Participant

    The 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”.

    in reply to: To create a new list widget or not that is the question. #1337605
    Ken Charity
    Participant

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

    Ken Charity
    Participant

    This reply is private.

    in reply to: Use filter to edit HTML around featured image #1186980
    Ken Charity
    Participant

    This 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?

    in reply to: Use filter to edit HTML around featured image #1186624
    Ken Charity
    Participant

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

    in reply to: tribe_is_event() failing on events without categories #973767
    Ken Charity
    Participant

    Thanks for the info.

    in reply to: tribe_is_event() failing on events without categories #973554
    Ken Charity
    Participant

    Ah 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?

    in reply to: X-theme + ECP integration issues (no title/breadcrumbs) #973343
    Ken Charity
    Participant

    Thanks 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?

Viewing 15 posts - 1 through 15 (of 31 total)