Loop posts without any taxonomy

One solution would be to give a value of “none” to your posts without any post group, similarly as you have “uncategorized” posts in WP Categories. Alternatively… I haven’t checked it, but why don’t you try to make another WP_QUERY like this: new WP_Query( array( ‘post_type’ => ‘page’, ‘page_group’ => ” ) )

Querying posts globally based on custom taxonomy with its own taxonomymeta table

For those running into issues in the future, this is what I did: I made my pre_get_posts function that queries the taxonomy as normal for testing if an taxonomy ID is not in a list: $q->set( ‘tax_query’, array(array( ‘taxonomy’ => ‘tax’, ‘field’ => ‘id’, ‘terms’ => tax_get_inactive(), ‘operator’ => ‘NOT IN’ ))); Then, I implemented … Read more

Get taxonomy that is attached to post with all its parents

You want get_ancestors(). This is pretty crude but… $locations = get_the_terms( $post->ID, ‘category’ ); // var_dump($locations); $pat=”<a href=””.site_url().’/location/%s”>%s</a>’; foreach ( $locations as $location ) { printf($pat,$location->slug,$location->name); $anc = get_ancestors($location->term_id,’category’); if (!empty($anc)) { foreach ($anc as $term) { $t = get_term_by( ‘term_id’, $term, ‘category’); printf($pat,$t->slug,$t->name); } } break; }

Complex Taxonomy scheme

Set your system up like this: locations – CPT administrative – hierarchical taxonomy natural – hierarchical taxonomy type – non-hierarchical taxonomy In the administrative taxonomy, you would create your tree: countries on the first level, regions second, departments and so on. Then, you would assign your locations to the smallest administrative denominations among your taxonomies … Read more

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