Alphabetizing Posts in a Category Page?

As I have stated, never ever use query_posts. The page you have linked to in the codex is worth nothing and completely wrong. For extra info on why not to use query_posts, check my answer here and the answer by @Rarst. You have another issue here, category_name does not accept the category name as value, … Read more

Filtering search results

You may need to include a tax_query for the Woocommerce taxonomy (called ‘product_cat’): $tax_query = array( array( ‘taxonomy’ => ‘product_cat’ ), ); $query->set( ‘tax_query’, $tax_query ); } return $query; } However, you’ll have to ensure that you can return posts AND pages AND product categories and also note the search results will be mixed up … Read more

Using separator with wp_list_categories

It looks like the default of the style input parameter is list. Try something like: ‘separator’ => ‘·’, ‘style’ => ‘separator’, // something else than ‘list’ to override the list default. We can see why this happens by peeking into the Walker_Category::start_el() method. There we have the following: if ( ‘list’ == $args[‘style’] ) { … Read more

Marking old posts as no longer relevant

Your gut feeling that option 2 would be more flexible is correct. Thankfully, Option 3 didn’t occur to you ( using post meta ), but Option 3 has a concerning caveat re: performance, so go with option 2 Then I thought actually, it would be more flexible to create a new category to which old … Read more

How to Import Categories with Descriptions from a CSV File?

Very simple plugin to achieve this. Runs only on activation, so, if there are 5 CSV files, the plugin must be activated/deactivated five times. File: /wp-content/plugins/create-cats-from-csv/create-cats-from-csv.php <?php /* Plugin Name: Insert CSV Categories Version: 1.0 Description: Reads a CSV file on plugin activation and insert the Categories/Description/Parent into WordPress as defined in the CSV Plugin … Read more

How to stop wordpress from showing the selected category on top of others in the category selection?

If I got this right, you need this plugin: Category Checklist Tree. On the post editing screen, after saving a post, you will notice that the checked categories are displayed on top, breaking the category hierarchy. This plugin removes that “feature”. Additionally, it automatically scrolls to the first checked category. Works with custom taxonomies too.

Return category slug / title from category ID

get_category will return all the information you need for both cases. $catinfo = get_category(get_field(‘category_test’)); From the Codex, that will give you (sample data obviously): stdClass Object ( [term_id] => 85 [name] => Category Name [slug] => category-name [term_group] => 0 [term_taxonomy_id] => 85 [taxonomy] => category Return category slug / title from category ID => … Read more