Created
August 14, 2013 20:32
-
-
Save MZAWeb/6235272 to your computer and use it in GitHub Desktop.
Cambiar theme según sección
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
<?php | |
add_action( 'wp', 'elegir_theme' ); | |
function elegir_theme() { | |
// Aca pones la condición que quieras verificar para decidir si cambiar el theme... | |
// Puede ser cualquier cosa, obviamente... is_page, is_tax, or cualquier cosa que necesites. | |
if ( is_page( 2 ) ) { | |
add_filter( 'stylesheet', 'cambiar_theme', 10, 1 ); | |
add_filter( 'template', 'cambiar_theme', 10, 1 ); | |
} | |
} | |
function cambiar_theme( $stylesheet ) { | |
// Nombre de la carpeta donde está el theme "secundario" | |
$stylesheet = 'twentytwelve'; | |
return $stylesheet; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment