Thanks for the great plugin!
We’re using the block editor for our custom post type. Setting a post as sticky from Quick Edit works just fine for our use case. However, we’ve found that editing a sticky post in the block editor causes the stickiness to be lost.
The workaround I’ve implemented is this:
add_action(
'block_editor_meta_box_hidden_fields',
function ( $post ) {
echo '<input type="hidden" name="sticky" value="' . esc_attr( is_sticky( $post->ID ) ? 1 : 0 ) . '" />' . PHP_EOL;
}
);
The underlying problem is that the edit_post()
function still fires when the block editor saves, and this logic unsticks the post unless sticky
is present in $_POST
: https://cln.sh/ycV65n
After activating your plugin, it did give us an option to mark a post as sticky. I marked the three in the first screenshot sticky. But that’s not the first three showing on the archive page: https://staging-petronerds.kinsta.cloud/newsroom1/
screenshot: https://www.dropbox.com/s/1enxfbdkvb9b37a/Screen%20Shot%202021-04-19%20at%203.37.05%20PM.png?dl=0
Please advise what to do.
Thanks!
]]>Hello,
we are working on a site and we have enabled your plugin in order to be able to introduce sticky functionality for the Custom Post Types that we have there. I got to say it works pretty well!
Only issue that we encounter is with the quick edit functionality. The problem is that even if the post is set to sticky, the checkbox would not be checked.
Photos for reference: https://prnt.sc/z7l9cl / https://prnt.sc/z7law5
We scanned the code of the plugin itself and it appears to be missing the check if the post is sticky and therefore add the proper attribute to the checkbox item
Will be glad if you could help us debug this issue or update the plugin on your site if needed!
Will gladly provide more information in case it’s needed
Thank you in advance!
]]>Will you update the plugin to make the sticky checkbox appear in the Gutenberg editor? It only works in the Classic editor.
Thank you!
]]>Hi!
I`m install your plugin in the site, next create a new post and set sticky post. But I not see a pinned sticky post. Can you help me please? My version WP 5.5.1 and php version 7.3
Hello,
The sticky checkbox works fine, I can see my post is a sticky post in the BO.
But in my front the sticky post is not in the first position.
My code :
$args_query = array(
‘post_type’ => array(‘project’),
‘order’ => ‘DESC’,
‘posts_per_page’ => 4,
);
Did I miss something ?
Thank you !
]]>This plugin seems to be no longer working with the latest version of WordPress and gutenberg
]]>Hey,
Great little plugin, thanks.
i have one problem, in my custom query it includes the sticky post and puts it in front as expected, the only problem is that when I say the posts_per_page = 6 it wil add the sticky posts and the total will increase.
This doesn’t happen with the plain posts, the total posts per page stays the same there and I would expect this would be also the case with my custm posts in combi with your little plugin.
The query I use is:
function l4l_get_lawyers( $num = - 1 ) {
$args = [
'post_type' => 'lawyers',
'posts_per_page' => $num,
'meta_key' => 'l4l_country',
'orderby' => array( 'l4l_country', 'post_name' ),
'order' => 'ASC'
];
$result = query_posts( $args );
wp_reset_query();
return $result;
}
Hope you can help me.
Thanks,
Niels