Support » Plugins and Hacks » [Resolved] [Plugin: Events Manager] Allow "Featured Events" by using STICKY posts?

[Resolved] [Plugin: Events Manager] Allow "Featured Events" by using STICKY posts?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Wooohoo – resolved! And by a nooob too.

    What I wanted was a way to say: this event is sticky (featured), stick it to the top of the events page above the search & list of other events.
    But with the CUSTOM POST TYPE events posts being contained and controlled by a PAGE and not being a regular list of posts, showing a sticky post was proving to be a bit tricky.

    I used http://wordpress.org/extend/plugins/sticky-custom-post-types/
    which, after adjusting the settings in SETTINGS > READING, adds a little “Stick this to the front page” box to your add/edit events post.

    THEN… after searching the net I added the following code (from here http://wordpress.stackexchange.com/questions/39483/broken-pagination) to the VERY TOP of wp-content/themes/twentyten/plugins/events-manager/templates/events-list.php

    (You also have to tell events manager to ignore formats in events-manager-options#pages > Event List/Archives > Override with Formats? > NO… then it will go looking for the events-list.php page)

    //////////////////////////////////////////////////////////////////// START STICKY
    // 1st loop - index.php
    // Get IDs of sticky posts
    $sticky = get_option('sticky_posts');
    // First loop to display only my single, most recent sticky post
    $most_recent_sticky_post = new WP_Query(array(
        // Only sticky posts
        'post__in' => $sticky,
        // Treat them as sticky posts
        'ignore_sticky_posts' => 1,
        // Order by ID
        'orderby' => ID,
        // Get only the most recent
        'posts_per_page' => 1
    while ($most_recent_sticky_post->have_posts()) : $most_recent_sticky_post->the_post(); ?>
        <!--  loop code -->
        <?php the_title(); ?>
        <?php the_excerpt(); ?>
    <?php endwhile; wp_reset_query();
    /////////////////////////////////////////////////////////////////////////////// END STICKY

    It’s very basic but it works. Just need to make it look pretty, add more than ONE sticky, add a slider, and more more more… but, still, I GOT A STICKY POST!

    And here’s an even better solution… (I scrapped the above one)


    Plugin Author Marcus


    well done for being a brave noob, out of curiousity, did you get the smooth slider plugin working with EM?

    Yes, smooth slider works well with EM. The plugin settings page has loads of adverts but other than that I’ve no complaints. It adds a smooth slider meta box to the bottom of every add/edit events admin page and you can decide there if you want your event featured. Then you just add a smooth slider shortcode above [CONTENTS] on your events page and voila!

    Plugin Author Marcus


    nice to hear! Will keep that in mind.

    Plugin Author Marcus


    inspired, I updated the demo site with this… http://demo.wp-events-plugin.com/

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] [Plugin: Events Manager] Allow "Featured Events" by using STICKY posts?’ is closed to new replies.