php - Get all posts from custom taxonomy in Wordpress -
Is there a way to get all the posts from a classification in WordPress?
In this taxonomy.php
, I have this code that receives the word from the word related to the current term.
$ current_query = $ wp_query- & gt; Query_versions; Query_posts (array ($ current_query ['taxonomy'] = & gt; $ current_query ['word'], 'showposts => 10));
I want to create a page with all the positions in the classification, regardless of the word.
Is there an easy way to do this, or do I have to check classification for words, then loop trough, etc.
$ Myterms = get_terms ('classification-name', 'orderby = none and hide for'); Echo $ myterms [0] - & gt; Name;
With this you will post the first item, then you can create a foreach
; Loop:
foreach ($ miter as word) {? & Gt; & Lt; Li & gt; & Lt; A href = "& lt ;? php echo $ word-> Slug;? & Gt;" & Gt; & Lt ;? Php ek $ word- & gt; Name; ? & Gt; & Lt; / A & gt; & Lt; / Li & gt; & Lt ;? Php}? & Gt;
In this way you list them, if you want to post them all, then my solution - engross a foreign virtual loop, but something like this should be: < / P>
foreach ($ myterms as word $): $ args = array ('tax_query' = & gt; array (array ($ word- & gt; slog)); // Assign variables to loop global $ wp_query; $ Wp_query = New WP_Query ($ Args); // The initial loop ($ wp_query-> is_posts ()): $ wp_query-> The_post (); Title(); Babla ... finally; Endforeach;
I have posted a lot like this.
Comments
Post a Comment