Skip to content

Instantly share code, notes, and snippets.

@MZAWeb
Created August 14, 2013 20:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MZAWeb/6235272 to your computer and use it in GitHub Desktop.
Save MZAWeb/6235272 to your computer and use it in GitHub Desktop.
Cambiar theme según sección
<?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