Solution to display one random Sticky Post
-
I thought this might help anyone else looking to display one random sticky post from a list of all sticky posts (eg. for the front page):
<?php $sticky=get_option('sticky_posts') ; $randomStickyNo=(rand()%(count($sticky))); query_posts('p=' . $sticky[($randomStickyNo)]); ?>
??
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Solution to display one random Sticky Post’ is closed to new replies.