Created
November 4, 2016 16:05
-
-
Save mrfoxtalbot/d7d1113fc1ec7af9df272c194ef7d7c6 to your computer and use it in GitHub Desktop.
Declarar y mostrar zonas de Widgets
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
// Primero lo declaramos | |
<?php | |
add_action('widgets_init','nuevowidget'); | |
function nuevowidget(){ | |
$args = array( | |
'name' => 'Nombre de la zona', | |
'id' => 'nombre-zona', | |
'description' => '', | |
'before_widget' => '<div>', | |
'after_widget' => '</div>', | |
'before_title' => '<h3>', | |
'after_title' => '</h3>' ); | |
register_sidebar($args); | |
} | |
?> | |
// Y luego lo llamamos en el Tema | |
<?php if (!dynamic_sidebar('nombre-zona')) {} ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment