Title: Sticky Posts
Last modified: August 30, 2016

---

# Sticky Posts

 *  Resolved [p10design](https://wordpress.org/support/users/p10design/)
 * (@p10design)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/sticky-posts-29/)
 * I was looking at this old question:
 * [https://wordpress.org/support/topic/sticky-posts-24?replies=8](https://wordpress.org/support/topic/sticky-posts-24?replies=8)
 * and I was wondering if this functionality was ever implemented? Thanks.
 * [https://wordpress.org/plugins/ajax-load-more/](https://wordpress.org/plugins/ajax-load-more/)

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Thread Starter [p10design](https://wordpress.org/support/users/p10design/)
 * (@p10design)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/sticky-posts-29/#post-6694610)
 * Although I don’t see an option or parameter to turn sticky posts on or off, I
   see that’s sticking.
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/sticky-posts-29/#post-6694639)
 * Sticky posts is not working with ALM and I don’t have any plans to sort this 
   out at the moment.
 * Sorry:(
 *  Thread Starter [p10design](https://wordpress.org/support/users/p10design/)
 * (@p10design)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/sticky-posts-29/#post-6694642)
 * Weird because I was able to get posts to stick. Any way, it’s not a big deal 
   right now. If that becomes an issue, I could have another query with sticky posts
   only.
 *  [icommstudios](https://wordpress.org/support/users/icommstudios/)
 * (@icommstudios)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/sticky-posts-29/#post-6694807)
 * Hope I’m not hi-jacking this thread… Is there a way to exclude all sticky posts
   the ALM loop?
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/sticky-posts-29/#post-6694808)
 * You would need to do a separate query for all sticky posts.
    Build and array 
   then pass it to the exclude paramaters.
 * Make sense?
 *  Thread Starter [p10design](https://wordpress.org/support/users/p10design/)
 * (@p10design)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/sticky-posts-29/#post-6694809)
 * $sticky = get_option(‘sticky_posts’); // returns an array with all sticky posts
   ids
    Then pass this as a parameter to ajaxloadmore post__not_in=$sticky
 *  [tobiasmalikowski](https://wordpress.org/support/users/tobiasmalikowski/)
 * (@tobiasmalikowski)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/sticky-posts-29/#post-6694879)
 * Needed this too, but while looking at the source code I found out that Dan’s 
   solution is not working cause post__not_in expects a string of post ids seperated
   by comma.
 * **So use this instead:**
 *     ```
       // Get ids of sticky posts (array)
       $sticky = get_option('sticky_posts');
   
       // Implode array to string, it's important to have no spaces around the comma
       $sticky = implode(',', $sticky);
   
       // Use your variable in the shortcode, don't forget your other attributes
       echo do_shortcode('[ajax_load_more post__not_in=' . $sticky . ']');
       ```
   
 * Hope this post helps someone struggling with this.
 *  [cody.me](https://wordpress.org/support/users/codyme/)
 * (@codyme)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/sticky-posts-29/#post-6694880)
 * Just to add to tobiasmalikowski’s code:
    You could also do it with exclude=”‘.
   $sticky.'” post__not_in=’ . $sticky . ‘] didn’t work for me so I used exclude
   🙂

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Sticky Posts’ is closed to new replies.

 * ![](https://ps.w.org/ajax-load-more/assets/icon-256x256.png?rev=2944639)
 * [Ajax Load More – Infinite Scroll, Load More, & Lazy Load](https://wordpress.org/plugins/ajax-load-more/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ajax-load-more/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ajax-load-more/)
 * [Active Topics](https://wordpress.org/support/plugin/ajax-load-more/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ajax-load-more/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ajax-load-more/reviews/)

 * 8 replies
 * 5 participants
 * Last reply from: [cody.me](https://wordpress.org/support/users/codyme/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/sticky-posts-29/#post-6694880)
 * Status: resolved