• Resolved naheekw

    (@naheekw)


    Hi,
    I am trying to add custom html and css to one event category list- I don’t want it to override the styles of all the event category lists – I just want to customize one event category’s list. I tried to add a conditional statement in list.php – as seen below – but it didn’t work. What do you suggest?

    if ( ! defined( ‘ABSPATH’ ) ) {
    die( ‘-1’ );
    }

    do_action( ‘tribe_events_before_template’ );
    ?>

    <!– Tribe Bar –>
    <?php tribe_get_template_part( ‘modules/bar’ ); ?>

    <!– Main Events Content –>
    if(tribe_meta_event_category_name() == ‘Professional Learning Conference’){
    <?php tribe_get_template_part( ‘list/prof-learning-conf-content’ ); ?>
    } else {
    <?php tribe_get_template_part( ‘list/content’ ); ?>
    }

    <div class=”tribe-clear”></div>

    <?php
    do_action( ‘tribe_events_after_template’ );

    https://www.ads-software.com/plugins/the-events-calendar/

Viewing 1 replies (of 1 total)
  • Hi @naheekw,

    Great question — If you are adding HTML to the template, then I would suggest using a conditional statement in there that checks for the current category, then adds your markup if it meets that condition.

    For example:

    <?php
        // Checks for List of of the "Shopping" Category
        if( tribe_is_past() || tribe_is_upcoming() && is_tax('shopping') ) {
          echo 'were on an list view category page for Shopping!';
      }
    ?>

    Then if you are on a specific category view, then there will be a body class that allows you to target your CSS for that specific page:

    .events-category-shopping {
      /* Your CSS */
    }

    Will this help you get started? Please let us know. ??

    Cheers!
    Geoff

Viewing 1 replies (of 1 total)
  • The topic ‘Event Category List Customization’ is closed to new replies.