Combining categories (Query posts with multiple taxonomy terms)

This type of behavior is documented in the WP_Query documentation. You can use a comma-separated list of category IDs instead of just one. For example (ripped right off the Codex page): $query = new WP_Query( array( ‘cat’ => ‘2,6,17,38’ ) ); With tags it’s a little different, but not too much so: $query = new … Read more

How to conditionally redirect to the post from a taxonomy page?

I think you can simply use WP_Term‘s $count property which should hold the number of posts attached to this current term.Then, if only one post is attached to this term, query this post object and do your stuff with it… $term = get_queried_object(); if ( $term->count === 1 ) { $args = array( ‘tax_query’ => … Read more

WordPress loop: Show only a Custom Post Type Taxononmy TERM

I found the solution by myself, I leave it here in case someone is interested: <?php $args = array( ‘post_type’ => ‘agrupados’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘pedidos’, ‘field’ => ‘slug’, ‘terms’ => ‘ferrol’, ), ),); $the_query_slide = new WP_Query( $args ); if ( $the_query_slide->have_posts() ) {while ( $the_query_slide->have_posts() ) {$the_query_slide->the_post();?> <?php /* variables … Read more

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