Categories RAW, without HTML

This topic contains 2 replies, has 2 voices, and was last updated by  Stephen Harris 4 years, 8 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #35503

    There is some way to paint the categories of the event.

    I’ve tried with: <? Php echo eo_get_event_meta_list (); ?>

    But it launches an HTML code, I just need the name of the category. Without the HTML structure.

    Sorry for my Google Translate.

    Thanks in advance.

    Sergio Martínez Montes
    #35508

    Solution:

    <?php 
    

    $categories = get_the_terms( $event_id, ‘event-category’ );
    //print_r($categories);
    foreach ($categories as $category) {
    echo $category->name;
    }
    ?>

    Sergio Martínez Montes
    #35539

    Hi Sergio,

    Glad you found the answer. If you need the colour of the event (which it derives from its category) you can use eo_get_event_color() or eo_get_category_color()

    Stephen Harris
Viewing 3 posts - 1 through 3 (of 3 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.