CMS & WordPress
I've made an important post on my WP blog as a "sticky" so that it always appears first at the top of the home-page.
Small annoyance... that same post also appears again in the order that I posted it. One workaround is to make the date older than all other posts so that it's second appearance is on the last (earliest) page.
Still, I'd like for it to appear only once, in it's top sticky position... any suggestions? Thanks.
See the "To exclude all sticky posts..." example for using query_posts() to change what posts appear in a list:
Lol weird, I just noticed this now too. It does appear twice, one on top, as a sticky, and then in it's natural order as per sorting or display method.
It also appears with a different background, like highlighted, in its natural order.
I had long forgotten about this, but wanted to try it. On that page that Dan mentions, at the top section that says "Usage" it shows to place the query_posts function on the Main Index Template (index.php) presumably between the first <?php tag and //The Loop
if ( have_posts() ) : while ( have_posts() ) : the_post();
The code to exclude all sticky posts from the query is:
Ok, but the index.php I have for the current WP 2.9.2 isn't quite exactly like that one example, so I tried:
<?php /* The LOOP starts here. Do this for all posts: */
while (have_posts()) : the_post(); $bfa_ata['postcount']++; ?>
Is that correct? It worked with the example for "return just the first sticky post or nothing" but when I try it with the code for "exclude all sticky posts from the query" ...the result is that if I go to "Older entries" I just keep getting the same first page (but with an incrementing page number each time)