Created
July 30, 2014 14:53
-
-
Save jpcontrerasv/192ab46848a80581590d to your computer and use it in GitHub Desktop.
WP > Wp_queries
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 $var_destacados = new WP_Query('post_type=destacados&showposts=6'); while ($var_destacados->have_posts()) : $var_destacados->the_post(); ?> | |
<?php endwhile; ?> | |
/*con taxonomias*/ | |
<?php | |
query_posts( array( | |
'post_type' => 'video', | |
'taxonomy' => 'programas', | |
'term' => 'la-escul', | |
'posts_per_page' => 4, | |
'cat' => '-204' | |
)); | |
if (have_posts()) : | |
while (have_posts()) : the_post(); | |
?> | |
<?php endwhile; endif; ?> | |
<?php wp_reset_query(); ?> | |
/*Excluir taxonomia del post type */ | |
<?php | |
query_posts( array( | |
'post_type' => 'video', | |
'posts_per_page' => 4, | |
'cat' => '-204', | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'programas', | |
'field' => 'slug', | |
'terms' => 'la-escul', | |
'operator' => 'NOT IN') | |
), | |
)); | |
if (have_posts()) : | |
while (have_posts()) : the_post(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment