WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Allow "Featured Events" by using STICKY posts? (7 posts)

  1. debsch
    Member
    Posted 2 years ago #

    I'm trying to feature some events and thought I could do so by making the event STICKY using this custom post type sticky plugin:
    http://wordpress.org/extend/plugins/sticky-custom-post-types/

    But it's not working and my guess is because the events are contained within a PAGE (using CONTENTS) and not as a list of custom posts?

    Is there any way I can feature some events and make them sticky or insert them into a featured post slider?

    Thanks.

    http://wordpress.org/extend/plugins/events-manager/

  2. debsch
    Member
    Posted 2 years ago #

    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)

    <?php
    //////////////////////////////////////////////////////////////////// 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!

  3. debsch
    Member
    Posted 2 years ago #

    And here's an even better solution... (I scrapped the above one)

    http://wordpress.org/extend/plugins/smooth-slider/

  4. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

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

  5. debsch
    Member
    Posted 2 years ago #

    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!

  6. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    nice to hear! Will keep that in mind.

  7. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic