Home › Forums › Calendar Products › Events Calendar PRO › Thumbnails not linking in shortcode list
- This topic has 7 replies, 2 voices, and was last updated 10 years, 3 months ago by
Nico.
-
AuthorPosts
-
January 28, 2016 at 10:42 pm #1064173
Nigel
ParticipantHowdy!
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!
January 29, 2016 at 11:04 am #1064606Nico
MemberHi 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,
NicoJanuary 31, 2016 at 10:31 pm #1065444Nigel
ParticipantHello 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!
February 1, 2016 at 7:37 am #1065758Nico
MemberHey 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,
NicoFebruary 1, 2016 at 10:05 am #1065880Nigel
ParticipantThank 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!
February 2, 2016 at 8:29 am #1066457Nico
MemberHi 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,
NicoFebruary 2, 2016 at 12:29 pm #1066568Nigel
ParticipantThat worked like a charm! Thank you very much, Nico!
February 2, 2016 at 12:47 pm #1066579Nico
MemberStocked 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 -
AuthorPosts
- The topic ‘Thumbnails not linking in shortcode list’ is closed to new replies.
