Change code to a unique category
-
I’m don’t know what I need to change at this code, because I just want to see in title order in one category (3), help me with the changes.
This is the code:
<?php
/*
Plugin Name: Sort Categories By Title
Plugin URI: http://www.mikesmullin.com
Description: Allows easy sorting of Categories by Title if your readers don’t care when things were posted.
Version: 1.0
Author: Mike Smullin
Author URI: http://www.mikesmullin.com
*/add_action(‘pre_get_posts’,’sort_categories_by_title’);
function sort_categories_by_title($x) {
if(is_category()) {
$x->query_vars[‘orderby’] = ‘title’;
$x->query_vars[‘order’] = ‘ASC’;
}
}
?>
The topic ‘Change code to a unique category’ is closed to new replies.