How to list categories in reverse alphabetical order?

Redefine arguments for ‘category’ taxonomy ONLY: add_filter( ‘get_terms_args’, ‘my_term_args’, 10, 2 ); function my_term_args( $args, $taxonomies ) { // don’t affect admin area passing back default arguments if ( is_admin() ) { return $args; } // check the taxonomy in use and redefine it’s default arguments if( in_array( ‘category’, $taxonomies ) ) { $args[‘orderby’] = … Read more

Category tags with comma’s

In this line: $cats .= $category->name . ‘, ‘; You append a name of category to variable called $cats. But you never reset this variable. So every post appends its categories to the same variable. So here’s how to fix this: <?php $categories = get_the_terms($custom_args->ID, ‘veranstaltungen-category’); $cats=””; // set empty string as value foreach ($categories … Read more

custom page for custom Taxonomy

The correct template to use in this case would be taxonomy-veranstaltungen-category.php, and that template needs to use the main loop. So, at a bare minimum you should have taxonomy-veranstaltungen-category.php with the following code: <?php get_header(); ?> <?php while ( have_posts() ) : the_post(); ?> <?php the_title(); ?> <?php endwhile; ?> <?php get_footer(); ?> That will … Read more

get_posts() from parent category only using a shortcode

If you don’t want to include posts in child categories, use the category__in parameter: $args = array( ‘category__in’ => [ get_cat_ID( $category_name ) ], // use category__in //’category_name’ => $category_name, // and not this. ‘post_type’ => ‘menu’, ‘numberposts’ => -1, ‘post_status’ => ‘publish’ ); And although the above would give you what you wanted, the … Read more

Multiple Category Search with and operator in WordPress

You are headed down the right path, but your syntax I think is a tiny bit off. cat is in fact a public queryable variable. https://codex.wordpress.org/WordPress_Query_Vars#List_of_Query_Vars Rather than the +, you’ll need to use a , instead and you’ll need a & in there to split them up. You should see results on your search … Read more