• Resolved donnytree

    (@donnytree)


    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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Barry

    (@barryhughes-1)

    Hi Donna!

    Sounds like a great idea and possibly another member of the community who has done something similar will be able to chime in — but on our end I’m afraid to say we can’t offer much in the way of custom dev support here, simply as we really need to prioritize our premium customers and we are currently experiencing very high demand in that arena.

    I do wish you luck with the project, though ??

    Thread Starter donnytree

    (@donnytree)

    Thanks Barry, I understand and appreciate your response.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘sticky event on home page’ is closed to new replies.