Show one category in photo view on home page

Home Forums Calendar Products Events Calendar PRO Show one category in photo view on home page

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1117963
    Rebecca Davis
    Participant

    Hi,
    I’m also trying to show just one category ‘featured’ in a photo view for a separate page. I’ve got things showing up as needed, but I’m missing how to get the single category or tag only. I’ve tried ‘taxonomy’ => ‘featured’ and ‘cat’ => ‘featured’ and ‘tag’ => ‘featured’ in the tribe_get_events array, but it’s still just pulls everything. You can see it on https://garfieldconservatory.org/staging/ Please let me know what I’m missing.

    <?php $events = tribe_get_events( array(
    'posts_per_page' => 9,
    'eventDisplay' => 'photo',
    'start_date'=> current_time( 'Y-m-d' ),// only upcoming & current
    'taxonomy' => 'featured'

    ), true ); ?>
    <?php if( $events->have_posts() ) :
    ?>

    <?php while( $events->have_posts() ) : $events->the_post(); ?>

    <div class="photo-featured">

    ">
    <div class="photo-thumb"><?php echo get_the_post_thumbnail( );?></div>
    <?php the_title(); ?>
    <br />
    <?php echo tribe_events_event_schedule_details(); ?>

    <?php the_excerpt(); ?>
    </div> <!--featured-->
    <?php endwhile; ?>

    Thanks

    #1117984
    George
    Participant

    Hey there!

    We unfortunately cannot help with custom coding, either in terms of writing it ourselves or in troubleshooting custom code written by yourself or others.

    So we will not be able to help see these customizations to the end. If you need assistance with any custom coding, please consider hiring a professional to assist you. We have a list of great developers here → http://m.tri.be/18k1 (and we have no affiliation with any of these folks–they’re simply some well-respected names in the community that we’ve compiled).


    Now, all of this being said, it seems that the core of your question comes down to specifying an Event Category in a WP_Query.

    You’re pretty close, so I wanted to try and offer at least some assistance here!

    You mention currently having something like this:
    'cat' => 'featured'

    Try specifying the taxonomy as tribe_events_cat instead, like this:
    'tribe_events_cat' => 'featured'

    ☝️ That’ll help filter things by Event Category; not by “tag” or by “post” category, but just event category.

    You’ll have to take the reins from here, but I hope this helps!

    George

    #1118042
    Brook
    Participant

    Howdy Becky,

    We were just talking about this. It seems like variations of this are a pretty common request, so the gentleman in charge said we could go a bit outside our Terms Of Service in helping you with more detail here. George of course nailed it on the advice, you probably only need to change that one line he mentioned. But if you do need further help let us know. 🙂

    Cheers!

    – Brook

    #1118215
    Rebecca Davis
    Participant

    Yep, that was it, calling the specific tribe_events_cat. I was pretty sure that’s where my issue was. Now it works, thank you. I have seen several threads trying to do the same thing and you’re right, this seems like it would be a pretty common request. I’ll share this in a post, but having a shortcode for something like this for the folks who aren’t theme devs would also be very helpful.

    Thanks for the help!
    Becky

    #1118232
    George
    Participant

    Awesome! Glad to have helped. While I’ll be closing this particular thread, open a new thread any time if there’s anything else we can help with along the way.

    — George

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Show one category in photo view on home page’ is closed to new replies.