WP_Query ignoring tax_query when is_singular

You can always use posts_clauses filter and add processing for tax_query in there (you don’t even need to write your own SQL): function filter_single_with_tax_queries( $clauses, $query ) { global $wpdb; if ( $query->is_singular ) { $query->parse_tax_query( $query->query_vars ); $tax_clauses = $query->tax_query->get_sql( $wpdb->posts, ‘ID’ ); $clauses[‘join’] .= $tax_clauses[‘join’]; $clauses[‘where’] .= $tax_clauses[‘where’]; } return $parts; } add_action( … Read more

Posts will not display on page-mypage.php

You can use custom query to show post in your template $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 10 ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); the_title(); the_content(); endwhile;

Get .subsubsub count of post per status queried using pre_get_posts

Ah! jQuery to the rescue! function custom_admin_js() { global $get_all_statuses; ?> <script type=”text/javascript”> jQuery(document).ready(function($) { //Bring my $get_all_statuses array and encode it for jquery var myObjects = <?php echo json_encode($get_all_statuses);?>; //Run a each loop : jquery equivalent to php’s foreach $.each(myObjects, function (index, value) { //console.log(index); //Status Label //console.log(index); //Status-name //count the WP list rows … Read more

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