- This topic has 9 replies, 2 voices, and was last updated 2 years, 6 months ago by Sally Richardson.
January 9, 2018 at 12:04 pm #1421730
Hi – I have managed to customise the photo view, within my child theme, to change the order of the display and also to remove the excerpt:
I have also tried to add the category name with its link (but have not succeeded with the link part) as you will see.
This is the thread I followed, but I realise the need here was slightly different (they did not need the link url).
What can I put in the single event file in order to display the category name as a clickable link (to the normal event category page) instead of purely text ? Also, I would ideally like to only show the primary category instead of all of them.
I have tried everything I can (I do not write code so it is a matter of following examples) and have got so close but….
Incidentally I did try using tribe_get_categories instead of tribe_get_text_categories, but then you get a label as well; also the list of categories are presented in a funny list with bullets…
Finally If I wanted to add a line to show tags in the same way, can you help me?
Fingers crossed that having got this far you can help me? I have searched and searched…! Thanks!January 11, 2018 at 5:16 am #1423408
Thanks for reaching out!
Good job on the customization!
To get the categories in a clickable way you only need to insert the following line into the single-event.php file:
<?php echo tribe_get_event_categories() ?>
This will give you a bullet point list of all the categories.
If you would like to change that, then you will need to format the string that is returned.
This is approx what is being returned:
<div class="tribe-events-list-photo-description tribe-events-content">
<li><a href="http://domain.com/events/category/import/" rel="tag">category name</a></li>
To only return the primary category is a bit tricky, because it’s difficult to define what the primary category is.
Hope this helps you get started. Let me know if I can guide you further.
AndrasJanuary 11, 2018 at 7:54 am #1423519
This reply is private.January 11, 2018 at 11:38 am #1423955
This reply is private.
January 12, 2018 at 3:06 am #1424479
- This reply was modified 2 years, 6 months ago by Sally Richardson.
This reply is private.January 14, 2018 at 3:33 pm #1426101
This reply is private.January 15, 2018 at 12:56 pm #1426848
This reply is private.January 15, 2018 at 2:52 pm #1426973
Superb Support as ever! Thank you very much indeed. Success!January 16, 2018 at 2:00 am #1427350
Stoked to hear that it worked out! 🙂 And thank you for the kind words.
Since this is marked resolved I am going to close this ticket, but if you need anything else related to this topic or another please create a new ticket and we’ll be happy to help.
PS: If you like our plugins, and you didn’t yet do so 🙂 we would be happy to receive a review in the wordpress.org repository. Thanks!
PS2: We’d be also grateful if you would give us feedback on your satisfaction with support. Just click on one of the classy looking emojis below. 🙂 If you can spare a few words, that’s even better. Doublethanks!
- The topic ‘Display category name and link url in photo view’ is closed to new replies.