Display a featured event in a front page feature box

Home Forums Calendar Products Events Calendar PRO Display a featured event in a front page feature box

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #12265
    Carlos
    Participant

    hey everyone. Trying to have an event assigned to the event category “feature” appear in the Thesis theme Feature box. Previously (before using ECP) any featured post would appear using the following code.

    function featurecontent() { ?>

    have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID;?>

    <a href=”” rel=”bookmark” title=””>

    <a href=”” rel=”bookmark” title=”Read the full article”>Read the full article →

    <?php
    }

    So the question is to get event category “feature” to appear, what do I use instead of (‘category_name=featured&showposts=2’)?

    Any ideas?
    Thanks in advance all.
    C

    #12278
    Rob
    Member

    Thanks for sharing, Carlos. We should be able to help at least point you in the right direction on this. Let me get our developer Jonah to chime in with his thoughts.

    #12305
    Jonah
    Participant

    Hi Carlos,

    Have you tried modifying the query using tribe_get_events() instead? That might be what you’ll need to do. You can see an example of the query with arguments in our doco: https://theeventscalendar.com/support/documentation/the-events-calendar-template-tags-general-functions/#functiontribe_get_events

    You can use any of the standard WP_Query arguments including category_name.

    #12347
    Laura
    Member

    Hi Carlos, I just recently had to do this myself. It took me quite awhile to figure it out but I finally got it.. Just use this to start your loop:

    $featured_query = new WP_Query(‘post_type=tribe_events&tribe_events_cat=featured&showposts=1&eventDisplay=upcoming’);
    if ($featured_query->have_posts()) while ($featured_query->have_posts()) : $featured_query->the_post();?>

    #12390
    Rob
    Member

    Thanks Laura (and Jonah)! Carlos, does that get you where you need to be?

    #974912
    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 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Display a featured event in a front page feature box’ is closed to new replies.