Viewing 4 replies - 1 through 4 (of 4 total)
  • Hey olie480. Thanks for the note. Have you checked out our documentation page at the tri.be website? If I understand your issue correctly you should find what you need there. It’s at http://tri.be/support/documentation.

    Let me know after reviewing the template tags/filters there whether you still have questions and I can try to point you in the right direction.

    Thread Starter olie480

    (@olie480)

    Thanks for the link, it is very helpful, although I couldn’t find a fix for the unique situation I am in.

    Basically, all I want to do is hide events in a specific event category from the all events page.

    Let’s say I have event categories
    cars, vans, scooter, company meetings and I want to exclude the events in the company meetings from the upcoming events.

    So when someone goes to:
    http://www.domainname.com/events/

    I get all the upcoming events including the company meetings. I just want to eliminate company meetings from Upcoming Events.

    I am thinking about this more, and I don’t really think it is possible, because I won’t be able to add into the WP_query that you guys use for the initial events page.

    I guess I could write my own WP_query and filter the events?

    Thread Starter olie480

    (@olie480)

    Alright, so I answered my own question and here is how I did it.

    Basically I made a custom WP_query to query the tribe events. I found out what the query was by doing a

    <?php echo "<pre>" . print_r($wp_query->query_vars); echo "</pre>"; ?>

    On the list.php page. Once I gathered what values were being passed, I then created a customized loop for the events.

    // ALL EVENTS EXCEPT FOR MEETINGS CATEGORY
    
    <?php
    $args = array(
    	"post_type" => 'tribe_events',
    	"eventDisplay" => 'upcoming',
    	'tax_query' => array(
                             array(
                                 'taxonomy' => 'tribe_events_cat',
                                 'field' => 'slug',
                                 'terms' => array('meetings'),
    			     'operator' => 'NOT IN'
                             )
            ),
    	"posts_per_page" => '1',
            "start_date" => date('Y-m-d H:i:s', strtotime("now")),
    	'orderby' => 'event_date',
    	'order' => 'ASC'
    );
    
    $events = new WP_query($args);
    ?>
    <?php while($events->have_posts()): $events->the_post(); ?>
    <p class="event-date"><?=tribe_get_start_date(); ?></p>
    <p  class="event-des"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></p>
    <?php endwhile; ?>

    I did the same for the meetings, but I just removed the NOT IN operator within the tax_query array.

    Thanks again Tribe for a great plugin! We definitely get great use out of it, and really haven’t had any problems.

    Awesome to hear you got this sorted, olie480, and thanks for confirming as much! We really appreciate you sharing your solution here for other users who may be in the same boat, too. Most appreciated and please let us know what else we can do for you in the future.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: The Events Calendar] How to Filter 1 category from All events page’ is closed to new replies.