Hi @suzannereid,
I’ve been looking into the bug reported, but wanted to provide some context since I don’t believe this to be a bug. The “Ignore Sticky Posts” option simply passes the ignore_sticky_posts
option into the WordPress query for retrieving those posts. This will prevent sticky posts from showing first, but they will still appear in their natural order.
What you’re looking for might be possible if run as a single query, but because you’re using multiple Recent Posts elements that means you are doing multiple queries. The next major release with the Layout Builder will offer some more advanced options in terms of how posts can be displayed.
This is possible with some custom development. I can’t give a full solution, but I can give you some ideas on how to create it.
- Copy the code from
cornerstone/includes/shortcodes/recent-posts.php
into functions.php
of a child theme.
- rename the function from that code from
x_shortcode_recent_posts
to something else. (e.g. x_shortcode_recent_posts_sticky
)
- rename the shortcode from
x_recent_posts
to something else. (e.g. x_recent_posts_sticky
)
- Adjust the parameters of the
get_posts
call to include only sticky posts. For example:
$posts = get_posts( array(
'orderby' => 'date',
'post_type' => 'post',
'post__in' => get_option('sticky_posts')
) );
Hopefully this helps you get an idea of what might be possible!