Thursday, July 14, 2022
HomeWordPress DevelopmentHow can I loop at a Particular Taxonomy from a customized submit...

How can I loop at a Particular Taxonomy from a customized submit sort?


So I’m caught as a result of I wish to loop by way of submit from a SPECIFIC taxonomy. So the Taxonomy is “State” and the submit sort is “Attorneys” . I’ve a bunch of attorneys which might be in Utah so I wish to loop by way of simply the attorneys in Utah.

<?php
       $states = get_terms('state');
       foreach($states as $state) {
            wp_reset_query();
            $args = array('post_type' => 'attorneys',
                'tax_query' => array(
                    array(
                        'taxonomy' => 'state',
                        'discipline' => 'slug',
                        'phrases' => $state->slug,
                    ),
                ),
            );

The array above is what i’m presently utilizing to loop by way of all of the attorneys from all the present ‘state’ taxonomy. My query is, what would i’ve to do to inform WordPress, simply loop by way of those that belong to the state of ‘utah’

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments