I figured it out:
around line 42, look for this:
$args = array_merge($args, array(
'orderby' => 'rand',
'showposts' => 1,
));
Add this:
'post_type' => 'your_post_type_goes_here',
So you end up with:
$args = array_merge($args, array(
'orderby' => 'rand',
'post_type' => 'your_post_type_goes_here',
'showposts' => 1,
));
I’m using AppThemes Vantage, so I use 'post_type' => 'listing',
😉
Plugin Author
scribu
(@scribu)
Or, you could use the ‘random_post_args’ filter defined two lines above:
function rpl_change_ptype( $args ) {
$args['post_type'] = 'your_post_type_goes_here';
return $args;
}
add_filter( 'random_post_args', 'rpl_change_ptype' );
(the code can go in your functions.php file, or in another plugin etc.)
Thread Starter
Anonymous User
(@anonymized-9678854)
Amazing! Can’t wait to try this out.
Thanks so much.