Show category in Event list wdget

Home Forums Calendar Products Events Calendar PRO Show category in Event list wdget

  • This topic has 6 replies, 2 voices, and was last updated 8 years ago by Durk Oberman.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1486372
    Durk Oberman
    Participant

    Hi there,

    On the frontpage of a website i use the widget Event List to show all the upcoming events.
    What i can not find how to show also the category of the event.
    Is that possible?
    See the attached image for an example.

    I am using The Events Calender Pro and build the frontpage with Siteorigin Page Builder.

    #1487573
    Jennifer
    Keymaster

    Hi Durk!

    You can add in the category by customizing the widget template. Our themer’s guide has instructions on doing template overrides, and the template for the list widget can be found at wp-content/plugins/the-events-calendar/src/views/widgets/list-widget.php. The tribe_get_event_categories function will get you the categories.

    We are a bit limited in the amount of support that we can provide for customizations, but if you get stuck or have any questions, please let me know – I’ll be happy to point you in the right direction!

    Thanks,

    Jennifer

    #1496738
    Durk Oberman
    Participant

    Hello Jennifer,

    Sorry for my late answer. IThank for your answer. I will get in to it and i am hopefull it will succeed.

    Thanks,

    Durk

    #1497358
    Jennifer
    Keymaster

    Great! If there is anything else that I can help with, please let me know.

    #1497854
    Durk Oberman
    Participant

    Hello Jennifer,

    Still one question.
    How and where do i put to code mentioned on tribe_get_event_categories into the list-widget.php?
    I hope you can help me with that.

    Durk

    #1499013
    Durk Oberman
    Participant

    following my last post:
    I have put the following code in the template list-widget.php: <?php echo tribe_get_event_categories(); ?>.

    Now the category is shown but there are also labels shown that i don’t want to be there.
    I found in general.php at row 425 this piece of code:

    'label'        => null,
    'label_before' => '<div>',
    'label_after'  => '</div>'

    My question, is it posible to not show the label (word) Evenement and put the name of the category behind the label Categorie?

    See also attachment.

    Thank.

    Durk

    #1506932
    Jennifer
    Keymaster

    Hi Durk,

    I’m sorry about the delay here…try replacing

    <?php echo tribe_get_event_categories(); ?>

    with

    <?php
    $args = array(
    'label' => 'Categorie',
    'label_before' => '<div class="list-widget-category-label">'
    );
    echo tribe_get_event_categories( $post->ID, $args );
    ?>

    Then, you can set the label and category to display on the same line by adding this CSS to the Additional CSS area under Appearance > Customize (if you have one) or to the style.css file of your child theme:

    .tribe-events-adv-list-widget .list-widget-category-label, .tribe-events-adv-list-widget .tribe-event-categories {
    display: inline-block;
    }

    As I mentioned previously, customizations like this are outside the scope of support that is provided here in the forums, but I hope this helps you get things working the way you would like!

    #1523630
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Show category in Event list wdget’ is closed to new replies.