Admin Panel – Disable Moving Selected Terms To Top of Metabox

Try adding this in your functions.php file: // Let’s stop WordPress re-ordering my categories/taxonomies when I select them function stop_reordering_my_categories($args) { $args[‘checked_ontop’] = false; return $args; } // Let’s initiate it by hooking into the Terms Checklist arguments with our function above add_filter(‘wp_terms_checklist_args’,’stop_reordering_my_categories’);

Get Default Post Category From Settings

You can access to default category ID via default_category option: $default_category = get_option(‘default_category’); Now you can use selected() function to generate the selected attribute: <?php $args = array( ‘type’ => ‘post’, ‘hide_empty’ => 0 ); $categories = get_categories( $args ); $default_category = get_option(‘default_category’); ?> <select name=”category_name”> <?php foreach($categories as $category){ if ($category->name != ‘Uncategorized’) { … Read more

Does the ‘cat’ argument in query_posts fetch posts from subcategories as well as the given ID?

In short: Yes. Your question is about the query_posts WordPress PHP function. The link I’ve placed is the official wordpress codex documentation for that function. For your example it states: Display posts from only one category ID (and any children of that category): query_posts(‘cat=4’); I hope this information is helpful. You find more infos in … Read more

Dropdown with category selection

Here is a variation of the code that you use. I’m using get_categories() here to achieve the same goal. I had to adjust my code slightly to make it acceptable for your need. There are a however other modifications you have to make for this to work. When you select the All Categories option, you … Read more