Display category name and link url in photo view

Home Forums Calendar Products Events Calendar PRO Display category name and link url in photo view

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1421730
    Sally Richardson
    Participant

    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:
    https://www.tashmina.co.uk/concerts/photo/

    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).
    https://theeventscalendar.com/support/forums/topic/display-just-category-name/

    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!

    #1423408
    Andras
    Keymaster

    Hi Sally,

    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">
    <div>Event Category:</div>
    <ul class="tribe-event-categories">
    <li><a href="http://domain.com/events/category/import/" rel="tag">category name</a></li>
    </ul>
    </div>

    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.

    Cheers,
    Andras

    #1423519
    Sally Richardson
    Participant

    This reply is private.

    #1423955
    Sally Richardson
    Participant

    This reply is private.

    #1424479
    Andras
    Keymaster

    This reply is private.

    #1426101
    Sally Richardson
    Participant

    This reply is private.

    #1426848
    Andras
    Keymaster

    This reply is private.

    #1426973
    Sally Richardson
    Participant

    Superb Support as ever! Thank you very much indeed. Success!

    #1427350
    Andras
    Keymaster

    Hi Sally,

    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.

    Cheers,
    Andras

    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!
    https://wordpress.org/support/view/plugin-reviews/the-events-calendar/
    https://wordpress.org/support/view/plugin-reviews/event-tickets/

    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!

     

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Display category name and link url in photo view’ is closed to new replies.