Support Forum ยป User Profile

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Custom query with taxonomy in a gutenberg block. #31475
    bossio.fabricio@gmail.com[email protected]
    Participant
    $books = mb_get_block_field( 'taxonomy_books');
    $queryBooks = new WP_query(array(
        'posts_per_page' => -1,
        'post_type' => 'books',
        'tax_query' => array(
            array (
                'taxonomy' => 'book',
                'terms'    => $books->taxonomy_books,
                'field'    => 'taxonomy_books',
            ) ),
    ));

    This is what my code would look like.

    But the query is not what I expected.

    As you can see in the image, the query brings me the values of all the posts that have a tag checked, but not the specific tag. But also, when marking the field in the block, it brings me the value of the taxonomy itself.

    in reply to: Custom query with taxonomy in a gutenberg block. #31405
    bossio.fabricio@gmail.com[email protected]
    Participant

    Greetings, although I used the taxonomy_advanced field, I did not get what I expected.

    Is something still missing?

Viewing 2 posts - 1 through 2 (of 2 total)