Sergey Makhnatkin
Forum Replies Created
-
Rachel, I respect you. I like your plugin and your support style: quickly and accurately. Good luck
Rachel, thanks!
My code worked on both versions (4.0 and 4.1) of WordPressНеllo!
So, I found a script that shows that the error not in WordPress update, but in plugin update to version 1.3.21) I restored from a backup the old code and database. So I turned WordPress 4.0 plugin 1.3.1
2) This code worked fine:
$args = array( 'post_type' => 'goods', 'posts_per_page' => '-1', 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'brand', 'field' => 'id', 'terms' => $brand_id, ), array( 'taxonomy' => 'catalogue', 'field' => 'id', 'terms' => $catalogue_id, ) ) ); $loop2 = new WP_Query( $args );3) I just updated the plugin to version 1.3.2 and the goods are no longer displayed
4) But this code not worked too:
$args = array( 'post_type' => 'brand', 'posts_per_page' => '-1', 'tax_query' => array( array( 'taxonomy' => 'catalogue', 'field' => 'id', 'terms' => $post_id, ), ) ); $loop2 = new WP_Query( $args );5) I just updated WordPress to version 4.1, and code specified in paragraph 4 earned. Сode specified in paragraph 2 not earned.
Rachel, I have another problem. I’m not 100 % sure that the case in the plugin, and not in my code, but the situation is as follows:
This code works fine:
$args = array( 'post_type' => 'goods', 'posts_per_page' => '-1', 'tax_query' => array( array( 'taxonomy' => 'brand', 'field' => 'id', 'terms' => $brand_id, ) ) ); $loop2 = new WP_Query( $args );and this is fine too:
$args = array( 'post_type' => 'goods', 'posts_per_page' => '-1', 'tax_query' => array( array( 'taxonomy' => 'catalogue', 'field' => 'id', 'terms' => $catalogue_id, ) ) ); $loop2 = new WP_Query( $args );But when I collect terms together, I can not get a list of products:
$args = array( 'post_type' => 'goods', 'posts_per_page' => '-1', 'tax_query' => array( array( 'taxonomy' => 'brand', 'field' => 'id', 'terms' => $brand_id, ), array( 'taxonomy' => 'catalogue', 'field' => 'id', 'terms' => $catalogue_id, ) ) ); $loop2 = new WP_Query( $args );Problem resolved.
Thanks!Thank you. On another topic, you suggested that decision:
// Get the taxonomy $taxonomy = isset( $this_query[ 'taxonomy' ] ) ? $this_query[ 'taxonomy' ] : NULL; // Make sure the taxonomy exists if ( ! $taxonomy || ! taxonomy_exists( $taxonomy ) ) continue;But it did not help me