Home › Forums › Calendar Products › Events Calendar PRO › Just show featured image shortcode
- This topic has 12 replies, 3 voices, and was last updated 6 years ago by Sky.
-
AuthorPosts
-
April 16, 2018 at 6:59 am #1508123cpetrieParticipant
Good morning,
What would the shortcode be to just show the featured image for a particular category? I am having trouble getting rid of the text. I would like to just show the featured images for all retreats, nothing else – similar to the image below.
Thank you!
April 17, 2018 at 11:03 am #1509530SkyKeymasterHi there!
I will try to help you figure out how to achieve this.
It looks like you will need to create a custom template to do this. You can copy the template from the-events-calendar-pro/src/views/pro/photo/single-event.php to [your-theme]/tribe-events/pro/photo/single-event.php and then make your modifications.
I would use a conditional to check for the category that you want to do this for, and create the desired content inside. We are starting from the “photo” view template, since this already has the featured image displayed nicely.
Here is the modified template: https://gist.github.com/skyshab/e3b9f16a37e9da7419c3eee915a2d509
You can just edit to change “my-target-category” on line 24 to be whatever you want to target. Then, your shortcode on the page would look something like:
[tribe_events view="photo" category="my-target-category"]
You can read more about customizing Events Calendar templates in our Themer’s Guide.
Let me know if that helps!
Thanks,
SkyApril 17, 2018 at 1:52 pm #1509655cpetrieParticipantHi Sky,
Unfortunately did not work. I am trying to put it on the home page. It
keeps giving me the whole calendar. I just want featured images of
certain events (categories) to show.—
CHRISTINA PETRIE | Website Design/Development
m: 206-856-0378
e: [email protected]
http://www.christinapetrie.com [3]Links:
——
[1] https://gist.github.com/skyshab/e3b9f16a37e9da7419c3eee915a2d509
[2] https://theeventscalendar.com/knowledgebase/themers-guide/
[3] http://www.christinapetrie.comApril 18, 2018 at 9:54 am #1510363SkyKeymasterHello again,
This is what appears for me using the above steps:
The search bar and title could also be hidden if desired.
When you say you are trying to do this on your home page, do you mean the same page that is set for the default Events Calendar settings? Please note that the shortcode can only be used once per page, and not on the same page as the default calendar.
I am unable to view the site, so I’m not sure what your setup is.
Thanks,
SkyApril 24, 2018 at 9:02 am #1514781cpetrieParticipantHi Sky – I was able to find a workaround using advanced posts. Everything working great except that I can not display the date because it is pulling the date from posted date -see bottom of this page http://jennyalignedyoga.flywheelsites.com/ . Ideally I would like to do the same thing with events calendar – image with extract and date under it. Is that possible with short code?
April 25, 2018 at 6:26 am #1515708SkyKeymasterHi there,
Check out the photo view example: https://wpshindig.com/events/photo/ This is very close to your screenshot.
You can start with the photo view template, and make any modifications you’d like, such as adding the button, etc.
Could you explain what you mean by “did not work?” What steps did you take? What result were you expecting? What result did you get? Please provide a screenshot.
Thanks,
SkyApril 25, 2018 at 8:38 am #1515891cpetrieParticipantHi Sky,
Still having trouble. If I use the following short code [tribe_events view=”photo” category=”classes”] I get the whole list. It is a vertical list. I want a horizontal list that is showing featured images.
April 25, 2018 at 12:08 pm #1516203cpetrieParticipantTrying different options and getting nowhere. What am I doing wrong. Keep getting list.
April 25, 2018 at 1:45 pm #1516328cpetrieParticipantI decided to forget about working with Events Calendar to do this. Had to find another work around due to time constraint.
April 26, 2018 at 5:31 am #1516689SkyKeymasterHi there,
I’m sorry to hear that you were not able to get this working. If you’d like to continue troubleshooting this, please let us know.
My guess is that you may not have the photo view enabled in the Events > Settings > Display > Enable event views. Make sure the checkbox for “Photo” is checked.
Thanks,
SkyApril 26, 2018 at 2:15 pm #1517347cpetrieParticipantYup. That was the problem. Photo needed to be checked. Pls. close ticket.
April 27, 2018 at 7:40 am #1517817SkyKeymasterGreat!
Take care,
Sky -
AuthorPosts
- The topic ‘Just show featured image shortcode’ is closed to new replies.