Thumbnails not linking in shortcode list

Home Forums Calendar Products Events Calendar PRO Thumbnails not linking in shortcode list

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1064173
    Nigel
    Participant

    Howdy!

    We’ve launched our new site and have placed your shortcode on the homepage – however the thumbnails don’t link to the event, they recycle the homepage.

    Is there an easy fix for this?

    Thanks!

    #1064606
    Nico
    Member

    Hi there Nigel,

    Thanks for reaching out to us and congrats on the site launch, looks great πŸ™‚

    From what I see in the ‘This Week Widget’ template the image is not included by default. Are you making an override of the template or using some code to add it? Can you share that code with me so I can take a look and see if I can make the link right?

    Please let me know about it,
    Have a great weekend,
    Nico

    #1065444
    Nigel
    Participant

    Hello Nico!

    Yes, I am making an override to the code. It’s worked beautifully, except for the links. The function appears to link the thumbnails automatically in other views, but it is redirecting “Home” in this case.

    The current code is:

    <div id="tribe-events-event-<?php echo esc_attr( $event->ID ); ?>" class="<?php tribe_events_event_classes( $event->ID ) ?> tribe-this-week-event" >
    
    	<?php echo tribe_event_featured_image( $event->ID, null, 'medium' ) ?>
    
    	<h2 class="entry-title summary">
    		<a href="<?php echo esc_url( tribe_get_event_link( $event->ID ) ); ?>" rel="bookmark"><?php echo esc_html( $event->post_title ); ?></a>
    	</h2>
    
    	<div class="duration">
    	<?php echo tribe_events_event_schedule_details( $event->ID ) ?>
    
    	</div>
    	<div class="fn org tribe-venue">
    		<?php echo tribe_get_venue_link( $event->ID ); ?>
    	</div>
    
    </div>

    No matter how I add a code, it does not recognize it. Also, if I duplicate h2 below the thumbnail, it will also link Home/current page as well, even though it clearly links to the event otherwise.

    Thank you for the congratulations and timely response!

    #1065758
    Nico
    Member

    Hey Nigel,

    Thanks for following up with the code! I’ve tested it locally and it’s working for me, but I discovered an error on how you are using tribe_event_featured_image that might be causing the link to fail.

    Change this line:
    <?php echo tribe_event_featured_image( $event->ID, null, 'medium' ) ?>
    to:
    <?php echo tribe_event_featured_image( $event->ID, 'medium' ) ?>

    Please check the function docs to understand this parameter change. Also give it a try and let me know if it works now,

    Best,
    Nico

    #1065880
    Nigel
    Participant

    Thank you for the tip, Nico!

    Unfortunately, after editing the code the thumbnail links are still linking ‘home’ for us. This is only occurring in the “This Week” widget. The links are working properly in every other view option.

    Thank you very much for your patience and troubleshooting!

    #1066457
    Nico
    Member

    Hi Nigel,

    Just re-checked this, and you are right! The tribe_event_featured_image is getting the global post/event ID to generate the link, and as I was looking into this in the same event page the link was correct but in the calendar home or other event page it failed. As a workaround we can emulate what the functions does internally. Please try the following code:

    ID, 'medium' );

    if ( ! empty( $image_html ) ) {
    echo '

    ';
    }

    ?>

    ID ) ); ?>" rel="bookmark">post_title ); ?>

    ID ) ?>

    ID ); ?>

    Hope this time it works πŸ™‚
    Best,
    Nico

    #1066568
    Nigel
    Participant

    That worked like a charm! Thank you very much, Nico!

    #1066579
    Nico
    Member

    Stocked to hear Nigel πŸ™‚

    I will log a ticket about this, so it can be tuned in the future. Thanks once again for the report and glad I could help!

    I’ll go ahead and close out this thread, but if you need help with anything else please don’t hesitate to create a new one and we will be happy to assist you.

    Best,
    Nico

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Thumbnails not linking in shortcode list’ is closed to new replies.