Support

Home Forums Event Espresso Premium Remove private events from carousel

Remove private events from carousel

Posted: February 14, 2023 at 8:34 am

Viewing 4 reply threads


zcsiteadmin

February 14, 2023 at 8:34 am

Hi,

I have published a private event, and would like to exclude it (and any private events) from events showing on my home page carousel. How can I do so?

Here is my existing code:
$featured_params = array(
‘paged’ => 1,
‘post_type’ => ‘espresso_events’,
‘posts_per_page’ => 3,
‘show_expired’ => FALSE,
‘orderby’ => ‘start_date’,
‘tax_query’ => array(
array(
‘taxonomy’ => ‘espresso_event_categories’,
‘field’ => ‘slug’,
‘terms’ => array( ‘ZC_Attendees’ ), // exclude taxonomy names form mulitple array(‘adult’,’action’,’adventure’);
‘operator’ => ‘NOT IN’,
),
));


Tony

  • Support Staff

February 14, 2023 at 11:21 am

Hi there,

Which plugin is this for?

You could try setting 'post_status' => 'publish' above.


zcsiteadmin

February 14, 2023 at 11:26 am

Hi,

It’s for Event Espresso. The events are all technically published, but I’ll give it a shot. The private does say it’s “Privately Published” under status, so maybe that will be enough of a distinction.


zcsiteadmin

February 14, 2023 at 11:33 am

Looks like it worked. Thanks!


Tony

  • Support Staff

February 14, 2023 at 12:05 pm

It’s for Event Espresso.

Event Espresso doesn’t have a ‘carousel’ output, so I don’t think it is 🙂

The events are all technically published, but I’ll give it a shot.

Sure they are, but just to explain private posts don’t have a post_status of publish.

Looks like it worked. Thanks!

Awesome, you’re most welcome.

Viewing 4 reply threads

The support post ‘Remove private events from carousel’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso