Still Having Issues with Recent Posts not showing Sticky Posts

Hey folks,

I was working on a forum post, but it’s now locked so I can add more replies to the post.

The home page is using the Recent Posts, but the changes made in the back end (in that forum post above) didn’t have any effect. If you go to the In the News page, you can see what three sticky posts should be displaying.

Any other ideas?

Hello Luke,

Thanks for updating in!

Please be advised that the changes made in your recent posts element will only apply with the recent posts element and not in your blog index. You can see that it has been applied in your homepage in the “HOMEBOY IN THE NEWS” section. This changes is for the recent posts element alone and will not affect the blog index.

I can see that you have modified your blog index and added the “Featured Articles” section. You should alter your WP_Query so that the blog index will no longer display the sticky posts. Perhaps these links can help you:

Please note that custom coding is outside the scope of our support. Issues that might arise from the use of custom code and further enhancements should be directed to a third party developer.

Thank you for your understanding.

Thanks RueNel.

I think we’re backwards here.

The Recent Post shortcode is only being used on the Home Page, not on the Index. Index is good; Home Page (and the Recent Post shortcode) is the problem. I only mentioned the Index because you can see which posts are sticky.

Does that make sense?

Hello Luke,

Please clarify that you want to display sticky posts in the recent posts shortcode? I have made some changes in your recent posts element shortcode so that the sticky posts will display first. When you check your homepage, the sticky posts are the ones that display in your homepage.

Do you want to display other post items as well? If that is the case, then you’ll have to adjust the number of post items just like what I did on the test page I created. You can check it in the secure note.

Thanks @RueNel.

Unfortunately, we’re not there yet—but maybe there’s some deeper issue with my config?

If you look at the posts (below), you’ll see that the Recent Post Shortcode is still displaying regular posts (the hard drive shredder)—but your reply made me realized that, yes, the index should still being showing them first. Reading online, it appears that Sticky posts only work on their category index page—is that true with the loop that the Recent Post Shortcode uses?

Apologies that this has been such a saga! Hopefully now we have the issue fully clarified?

Appreciate the help.

Luke

Hi Luke,

I tested Ruenel’s code on that other thread on my dev site and it works (display sticky posts first).

A different approach with this (without customazation) is to apply a common category on those sticky posts (e.g. feature posts), then use that category to filter the Recent Posts element.

Sticky posts should be displayed on Blog (news) index posts first by default. Try removing or commenting out the other functions on your child theme’s functions.php file and leave only the code provided by Ruenel, how you added the Featured Articles on top of Blog (news) index might have something to do with this,

It could be a plugin conflict too, please do testing for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

Let us know how it goes,
Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.