Help with query_posts()
-
So I have this little piece of code that retrieves random posts from the database in order to display them in the sidebar (widget).
$args = array( 'posts_per_page' => $show_count, 'post_type' => 'post', 'post_status' => 'publish', 'orderby' => 'rand' ); query_posts($args);I need a little bit of help editing it so that it wouldn’t select one of the 10 latest posts (that are shown on the front page) nor the current post (for example if a user is reading an article, that article id to be excluded from this query so there is no chance that the widget will output the same article in the ‘Random Post’ box).
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Help with query_posts()’ is closed to new replies.