Home › Forums › Calendar Products › Events Calendar PRO › How to insert an image (thumbnail) in countdown widget ?
- This topic has 7 replies, 2 voices, and was last updated 9 years, 12 months ago by
George.
-
AuthorPosts
-
April 26, 2016 at 7:42 am #1107088
Laurent Lecler
ParticipantHello,
how can i insert the thumbnail of the event in the countdown widget (above the title and the counter if possible) ?
I’ve made it for the event-list widget and works fine…
http://www.grizette.com/agenda/Thx great team π
April 26, 2016 at 9:59 am #1107248George
ParticipantHey @Laurent,
You can modify the Countdown Widget’s contents by making a custom widget template using the principles outlined in this guide β https://theeventscalendar.com/knowledgebase/themers-guide/
Head into your plugin files for Events Calendar Pro, to the file located at /src/views/pro/widgets/countdown-widget.php
Override this template in your own theme by creating a file at [your-theme]/tribe-events/pro/widgets/countdown-widget.php, and then add images and all other customizations you want to make here! π
Cheers,
GeorgeApril 26, 2016 at 11:05 am #1107286Laurent Lecler
ParticipantThanks Georges,
I already know all this, it’s writen in the knowledge base…
The problem is that i don’t know what code i can put in the countdown-widget.php to achieve what i want to have :
Displaying the image of the event !April 26, 2016 at 6:51 pm #1107501George
ParticipantHey Laurent,
Thanks for the follow-up!
When it comes to writing code, you unfortunately have to do this yourself because we can not help with writing code. You can learn more about this here β https://theeventscalendar.com/knowledgebase/what-support-is-provided-for-license-holders/
If you are not able to write the code yourself, your best option is to hire a developer to do so for you.
Now, all this being said, adding the “Featured image” of the event is a bit simple. Once you have your custom version of the countdown-widget.php file going, try adding code like this inside that file:
<?php echo tribe_event_featured_image( $event->ID ); ?>A full example version of this file is located in a Gist I made for you here β https://git.io/vwVGN
You’ll have to take the code from there and tinker and style things how you want; but I hope this helps!
Sincerely,
GeorgeApril 27, 2016 at 7:35 am #1107668Laurent Lecler
ParticipantHi Georges,
you’re very kind with me (and all your customers because this would be great to have this option without coding)The code is ok but it gives a false URL to the image (url of the last post in the page).
Can you give me the code for liking the event URL to the image ?Or perhaps it would be better to insert the code you provide me in the event title (wich have a valid link to the event) instead of in the countdown itself ?
Thank you very much for your time, sure you’ll be proud to showcase our site in near future π
You can see the code in action here in the side bar : http://www.grizette.com/news-buzz/
-
This reply was modified 9 years, 12 months ago by
Laurent Lecler.
April 27, 2016 at 4:55 pm #1108000George
ParticipantHey Laurent!
I unfortunately cannot help with any other coding. Please read this page to learn what we can help with β https://theeventscalendar.com/knowledgebase/what-support-is-provided-for-license-holders/
To further realize the customizations you want, you would have to write that custom code or hire a professional developer to do it for you. We have a list of great developers here β http://m.tri.be/18k1 (we have no affiliation with any of these folksβtheyβre simply some well-respected names in the community that weβve compiled to share).
Best of luck with your tinkering,
GeorgeApril 28, 2016 at 6:25 am #1108160Laurent Lecler
ParticipantOk Georges,
I didn’t thought it was so difficult to achieve that…
So the code you gave me is impossible to use !
Nevermind i’ll not use the countdown widget.I suggest that the team work on the widgets to extend them with images (countdown, eventlist…).
As you certainly know the net is becoming more and more visual.
The big interest in a countdown is to give the focus to an event so the image is needed, the title is not enouth.Or perhaps you can publish a little tutorial in the knowledgebase like the one you made for Adding thumbnails to upcoming events List Widget π
Thanks for your assistance
April 28, 2016 at 5:55 pm #1108551George
ParticipantThat’s a great tip, @Laurent, and I’m sorry about the outcome of this thread. When I try the code modification that I suggested above, it works fine for me, so I am not sure why it’s not working for you. Sorry for the trouble!
Sincerely,
George -
This reply was modified 9 years, 12 months ago by
-
AuthorPosts
- The topic ‘How to insert an image (thumbnail) in countdown widget ?’ is closed to new replies.
