Random Post Section Showing Content from ALL Categories when Only Should be 1
-
Hey Guys,
I have a bit of a problem. I have a random post displayed in my sidebar, along with an image to go with it. Problem is, there are posts from all categories showing up when I have explicitely set it up so posts from only the gallery section should appear.
Here i first tried:
<?php $rand_posts = get_posts('numberposts=1&cat=9&orderby=rand');?>
That didnt work, so I then tried to use:
<?php $rand_posts = get_posts('numberposts=1&cat=9,-10,-1,-3&orderby=rand');?>
This also hasn’t made a difference. So posts from all categories are showing up, but I only want posts from the gallery section appearing.
The site in question: http://www.purekatyperry.com
Please help or point out where exactly I am going wrong. It will be very much appreciated. Thank you for your time.
Andrew
- The topic ‘Random Post Section Showing Content from ALL Categories when Only Should be 1’ is closed to new replies.