Show category name without link

Home Forums Calendar Products Events Calendar PRO Show category name without link

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1011085
    Mats
    Participant

    Hi!

    Im new to this plugin and i´m just trying to do something real simple, but can´t figure it out.
    I want to display the category assigned to an event, and not have it link to a archive page for that category.

    After some searching I found this:

     <?php $terms = get_the_terms( $post->ID , 'tribe_events_cat' );
    foreach ( $terms as $term ) {
    echo $term->name;
    }?>
    <?php echo get_the_terms( $post->ID, 'tribe_events_cat'); ?>

    But it outputs the word “Array” after each category name… so maybe my problem is elsewhere..

    Anyone?

    #1011318
    Josh
    Participant

    Hey Mats,

    Thanks for reaching out to us!

    A couple of quick notes:

    • You should delete the last line of the snippet. This is most likely what is outputting the “Array” since that is the expected return from a “get_the_terms()” function call
    • Where do you currently have this code added? For which view are you wanting the category to be displayed for?

    Thanks!

    #1011330
    Mats
    Participant

    Hey Josh!
    Thanks for answering.

    I have this code in tribe-events/list/singe-event.php
    In my own theme folder.

    Removing <?php echo get_the_terms( $post->ID, 'tribe_events_cat'); ?> worked!

    Thanks!

    #1011817
    Josh
    Participant

    Hey Mats,

    Great! Are the categories now showing for you the way you would like for that page?

    Thanks!

    #1016521
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Show category name without link’ is closed to new replies.