Exclude is ‘post__not_in’.
This is legacy syntax.
It get’s converted to ‘post__not_in’ before running the query.
Uhm, anyway, with ‘exclude’ didn’t work, replacing it with ‘post__not_in’ instead works. I’m using WP 4.2.2.
Well that’s weird than… because ALM shouldn’t recognize the post_not_in.
// Exclude posts
if(!empty($exclude)){
$exclude = explode(",",$exclude);
$args['post__not_in'] = $exclude;
}
🙂
This snippet is only used in alm_query_posts, I meant in preloaded post query, here this fallback there isn’t.
I pulled that snippet from the preloaded add-on.
And I just tested and was able to exclude posts using this shortcode.
[ajax_load_more preloaded="true" preloaded_amount="4" post_type="post" exclude="129"]
Uhm, never mind, on a brand new install works.
Thanks for your time
Thanks for this post – saved me a lot of time.
post__not_in was working for me on non-preloaded calls, but not on preloaded calls.
exclude works correctly on both.
Should the list of shortcode attributes at https://wordpress.org/plugins/ajax-load-more/ be updated? exclude isn’t on this list and post__not_in is; that’s why I was using it.
Exclude is still available but it is post_not_in in the shortcode builder since 2.8.6 or something… Users should be using post__not_in like wp_query.
Weird its not working for you in preloaded. Assuming you have the latest version? 1.2.7 ?
Oh, no I don’t! I have 1.2. Should WP be notifying me of updates to Preloaded? Or do you just get what you get when you buy it?
You only get updates if you have a valid license.
Ok, I guess my question is the same (sorry, I know this is going a bit off-topic from this thread now) – how do I apply that license to WP? I purchased Preloaded on 16th Apr 2015; should WP be notifying me of updates? Or do I need to purchase again?
Can you send a support request here? With the email used to purchase.
I will send you your license key
https://connekthq.com/plugins/ajax-load-more/support/
Will do. Thanks heaps Darren!