Created
May 28, 2014 17:35
-
-
Save leocaseiro/7e014f8165bf8ad066de to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$params = array('post_type' => 'garimpeiros', 'paged' => $paged); | |
if (isset($wp_query->query_vars['estado']) && '' != $wp_query->query_vars['estado'] ) : | |
$params['tax_query'] = array( | |
array( | |
'taxonomy' => 'estado', | |
'field' => 'slug', | |
'terms' => array($wp_query->query_vars['estado']), | |
) | |
); | |
endif; | |
$garimpeiras = new WP_Query($params); | |
?> | |
<ul> | |
<?php if ( $garimpeiras->have_posts() ) : while ( $garimpeiras->have_posts() ) : $garimpeiras->the_post(); ?> | |
<li><?php the_title(); ?></li> | |
<?php endwhile; else: ?> | |
<li><?php _e('Sorry, no posts matched your criteria.'); ?></li> | |
<?php endif; ?> | |
</ul> |
No, the taxonomy is estado and the custom post is garimpeiros!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Leocaseiro,
This gist return all post with the custom taxonomy "garimpeiros" right?