I want to make the speakers widget randomly sorted instead of of the latest post.
I know this piece of code in the widget.speakers.php is responsible for that, but don't know how to make it random:
- Code: Select all
$gk_loop = new WP_Query( 'category_name=' . $category . '&post_type=' .$options_tmp['name'] . '&posts_per_page=-1');
I fixed it already for the category view in the category-speakers.php file by replacing it with this code:
$args = array( 'post_type' => $tmp['name'], 'order' => 'ASC', 'orderby' => 'rand', 'posts_per_page' => 100 );
Can you help me to fix it also in the widget code? Thanks alot!