Ordering by Specific Category PHP
-
Hello. I’m trying to make a category display instead of random posts in slide.php of Zinmag Tribune theme.
I’m editing slide.php which rotates thumbnails and descriptions of certain posts. originally the code looked like this
$my_query = new WP_Query(‘orderby=rand &showpost=2’);
while ($my_query->have_posts()) : $my_query->the_post();$do_not_duplicate = $post->ID;I would just like to switch the ‘orderby=rand to display posts from a specific category instead of random posts.
I did change it to ‘orderby=category and it is now only displaying posts from the front page for some reason. Any help greatly appreciated.
cheers
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Ordering by Specific Category PHP’ is closed to new replies.