Site logo

Archived topic

Show sticky post at top of category

5 replies · Started by Matt on May 27, 2021

Viewing posts 1–6 of 6

Hi,

I've got a post in a category that i'd like to have stickied to the top of just that category.

I've tried using a hook with generate_after_archive_description, shortcode and execute php ticketed, with display rules of post category archive and the specific category selected.

Then the body of the hook is a shortcode for a show posts list which is post type post, posts per page 1, 1 column, and the post id as the one for the specific post I'd like displayed.

However, nothing is displayed where i'd like it to be or at all? I'm sure I'm missing something small

Hi there,

try changing the Hook to generate_after_header and set the Priority to 20

Is there a way of keeping it within the main body of content instead of above the content/sidebar?

Could you try generate_before_main_content hook?

That seems to be the best so far, is there any way of defining custom css for the element or wp show posts post to get it to display a little more like the other posts?

I can customize it myself to fit but can't a way of defining custom css or custom classes within elements or wpsp?

The WP show posts list which inside an element share the same CSS class as other WP show posts.

If you open the developer tool in chrome, you will find the WP show posts section here, and all the CSS classes of it.
https://www.screencast.com/t/bwiKHuw1bsv

This archived topic is closed to new replies.