Showing all posts of the current custom taxonomy on archive page

I have finally found a solution and for anyone interested, here is the working code : <?php // The Query if (is_tax() || is_category() || is_tag() ){ $qobj = $wp_query->get_queried_object(); // concatenate the query $args = array( ‘post_type’ => ‘houses’, ‘posts_per_page’ => -1, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’, ‘tax_query’ => array( array( ‘taxonomy’ => … Read more

Operator ‘AND’ in the get_posts() function’s tax_query terms not working

Try adding include_children parameter as false to your first example (tested): $args = array( ‘post_type’ => ‘workshops’, ‘posts_per_page’ => -1, ‘fields’ => ‘ids’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘workshop_categories’, ‘field’ => ‘slug’, ‘terms’ => array( ‘crafts’, ‘jewellery’ ), ‘operator’ => ‘AND’, ‘include_children’ => false, ) ) ); $posts = get_posts( $args ); Unfortunately I … Read more

How to get taxonomy category in permalink for each taxonomy OR How to give a parent page to a given taxonomy?

This worked for me (tested): add_action( ‘init’, static function () { register_taxonomy( ‘portfolio-work’, ‘post’, array( ‘hierarchical’ => true, ‘labels’ => array( ‘name’ => ‘Portfolio Works’, ‘singular_name’ => ‘Portfolio Work’, ), ‘rewrite’ => array( ‘slug’ => ‘work’, ‘with_front’ => false, ), ) ); } ); Then created new pages titled “Blog” (slug: blog) and “Work” (slug: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)