About Sridhar Katakam
I am an independent WordPress web consultant with 10 years of experience in WordPress theme installation, customization, administration, maintenance, support, documentation, troubleshooting and PSD/design to WP.
Genesis and WordPress Tutorials
Session expired
Please log in again. The login page will open in a new tab. After logging in you can close it and return to this page.
This is nice! Question though. I don’t think hosting companies recommend using ORDER BY 1 in a mySQL query. Is that the same as giving ‘orderby’ => ‘rand’ as a parameter to WP_Query?
This worked beautifully – thanks so much đŸ™‚
Annabel
Thank you so much. This works perfectly
Thought this might be a cool idea, searched, found and implemented in about 2 mins.
Brilliant and thanks!
\m/
Hi,
Thank you very much for this! It was easy to implement and works as advertised. At the moment it displays a random selection of posts from all categories. How can edit the code so that only the posts from a certain post category are displayed?
For example, I have a category called “testimonials”. How can I display only those posts that are in this category?
Thank you in advance!!!
Try http://pastebin.com/raw.php?i=AqWxJ9Fm.
Source: http://codex.wordpress.org/Class_Reference/WP_Query#Category_Parameters.
I had looked at the WordPress Category Parameters before but didn’t realize that I needed to use the category slug not the category name itself. The category name is written in Japanese so it didn’t work. I thought I was doing something wrong so I asked you for help. After implementing your new code it still didn’t work. So, I went back and read the wordpress category parameters more closely and then discovered that the slug is needed.
That worked a dream!
Thank you so much for your help!!
Very cool – can this be used to create a widget too? I’d like to create a home page section that shows a random author’s post title & featured image (actually 2 or 3 of them), along with some author info (avatar & bio). This would basically be a way to showcase authors on the homepage for a magazine site.