Support » Plugin: Seamless Sticky Custom Post Types » Ignore Sticky Posts in (CPT) Posts Admin page

  • Resolved TrishaM

    (@trisham)


    I LOVE this plugin, and consider this to be a very minor issue, but one I’d like to resolve if possible.

    On my custom post type’s post admin page that shows all the posts, it puts the sticky ones at the top, instead of ignoring stickies and just showing them in the default publish-date order.

    I know how to control stickies in all the loops I’ve done on pages where I display them, but to modify the overview page requires a function in my functions.php and I’m just not getting it……I’m guessing (because I’m not a coder) that I need to override the query to insert $query->set(‘ignore_sticky_posts’,’true’) but I’m not sure where to hook into…..

    I’ve tried hooking into pre_get_posts and created a function that checks if is_admin, like so:

    if ( is_admin() && $query->is_main_query() ) {
            $query->set( 'ignore_sticky_posts', 'true' );
        }

    But it doesn’t work – the sticky posts are still at the top.

    Any help would be most appreciated!

    https://wordpress.org/plugins/seamless-sticky-custom-post-types/

Viewing 1 replies (of 1 total)
  • Thread Starter TrishaM

    (@trisham)

    Sigh…..nevermind, I figured this one out…..

    I had a function (in my functions.php) that modified the archive loop to keep sticky posts at the top on archive/category pages (which isn’t normal for WP) and I neglected to add !(is_admin) to the test….once I added that it now puts my (admin) CPT post overview page in the correct order (publish date) with the stickies in their normal chronological order.

Viewing 1 replies (of 1 total)
  • The topic ‘Ignore Sticky Posts in (CPT) Posts Admin page’ is closed to new replies.