I know that this code randomizes the posts inside their category
function exclude_category( $query ) {
if ( $query->is_category() && $query->is_main_query() ) {
$query->set( 'orderby', 'rand' );
}
}
add_action( 'pre_get_posts', 'exclude_category' );
I am currently using this. Is there a way to set a top navigation area where it gives the option to click for the Newest since its now at Random? Maybe even a ‘Newest | Most Popular | Random’ option.
Thanks in advance!
Hi,
Unfortunately the theme doesn’t have a feature like that and you will need custom work to achieve that as we work hard on the development, updates, fixes and support we cannot offer custom work.
You can try to find a plugin that dose that or you can always get a freelancer from sites like: http://studio.envato.com/ if you don’t know how to do it yourself.
Thanks
Hi,
You need to edit the functions.php file to add that function for category posts.
The category template is category.php file which use the loop.php file.
You can read here more about the default values: http://codex.wordpress.org/Template_Tags/wp_list_categories
Thanks