sticky event on home page
-
Hello,
I would like to make an Event custom post type sticky on the home page of my website so that if there is a sticky Event custom post it appears, but if not, then my non-Event Posts marked sticky appear. Here is the code I would like to use:
$argsSticky = array( 'posts_per_page' => 1, 'post__in' => get_option('sticky_posts'), 'post_status' => array('publish', 'future'), 'post_type' => array('post','tribe_events'), 'order' => DESC, 'caller_get_posts' => 1 );
Is there any way to do this? Somehow, I am guessing when I imported my events, Sticky was added to one of my Events and the code above worked perfectly. When I removed the Category from the Event custom post type, the Sticky assignment went away and I cannot get it back.
If I could use the Featured Event or Sticky in Month view hook in my query, that could work too. For some reason tag and category aren’t working, e.g.,
$query = new WP_Query( array( 'post_type' => 'tribe_events', 'showposts' => 1, 'order' => 'ASC' ), array( 'tag' => 'sticky' ) );'
$query = new WP_Query( array( 'post_type' => 'tribe_events', 'showposts' => 1, 'order' => 'ASC' ), array( 'cat' => 58 ) );
And when I use these queries, the Event always appears whether or not it has the specified tag or is in the selected Category.Thank you in advance,
Donna
- The topic ‘sticky event on home page’ is closed to new replies.