tshirtfiend
Member
Posted 11 months ago #
Is there a way to only show the posts that I've marked as sticky on my homepage?
Setting the # of posts just adds to the number of sticky posts, as some people have pointed out (eg. 5 posts + 5 sticky posts = 10 posts). At the same time, however, I can't choose to display 0 posts.
Anybody have a solution?
sleeplessinDC
Member
Posted 11 months ago #
The answer is well hidden. You can set sticky posts using the Publish box in the right column. Click on "Visibility" Edit. That will open a dropdown menu with a checkbox to stick the post to the homepage.
tshirtfiend
Member
Posted 11 months ago #
@filosofo: Thanks for the reply. For some reason, I didn't see it sooner.
I'm not sure how to use the conditional template tag in this situation, however. Should I use the conditional tag instead of the loop (in my index.php file), or is there a way to use it with the loop? I tried a couple things, but to no avail.
@sleeplessinDC: Appreciate the thought, but I got the sticky thing figured out. I'm looking to display ONLY sticky posts on my homepage.
tshirtfiend
Member
Posted 11 months ago #
Ok, think I figured it out. Found another forum post that suggested this:
<?php query_posts(array('post__in'=>get_option('sticky_posts'))); ?>
And it seems to be doing what I need it to. I put that on the line before my loop.
I just have to figure out how to order the sticky posts now…