Created
April 22, 2013 20:28
-
-
Save anonymous/5438249 to your computer and use it in GitHub Desktop.
Hook de pre_get_posts
This file contains 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
function cambia_queries ( $query ) { | |
if ( $query->is_category(31) && $query->is_main_query()){ //31 es la categoria donde quiero se muestre el cambio | |
$query->set('cat','18,31');//31 es la categoria actual, y 18 la categoria que quiero añadir para mostrar | |
} | |
} | |
add_action( 'pre_get_posts', 'cambia_queries'); | |
// Cambiamos el query con pre_get_posts | |
add_action( 'pre_get_posts', 'cambia_queries' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment