Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    Exclude is ‘post__not_in’.
    This is legacy syntax.

    It get’s converted to ‘post__not_in’ before running the query.

    Thread Starter yurifari

    (@yurifari)

    Uhm, anyway, with ‘exclude’ didn’t work, replacing it with ‘post__not_in’ instead works. I’m using WP 4.2.2.

    Plugin Author Darren Cooney

    (@dcooney)

    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;
    }

    🙂

    Thread Starter yurifari

    (@yurifari)

    This snippet is only used in alm_query_posts, I meant in preloaded post query, here this fallback there isn’t.

    Plugin Author Darren Cooney

    (@dcooney)

    I pulled that snippet from the preloaded add-on.

    Plugin Author Darren Cooney

    (@dcooney)

    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"]

    Thread Starter yurifari

    (@yurifari)

    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.

    Plugin Author Darren Cooney

    (@dcooney)

    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?

    Plugin Author Darren Cooney

    (@dcooney)

    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?

    Plugin Author Darren Cooney

    (@dcooney)

    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!

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

The topic ‘Preloaded posts ignore exclude attribute’ is closed to new replies.