Skip to content

Instantly share code, notes, and snippets.

@mrfoxtalbot
Created November 4, 2016 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrfoxtalbot/d7d1113fc1ec7af9df272c194ef7d7c6 to your computer and use it in GitHub Desktop.
Save mrfoxtalbot/d7d1113fc1ec7af9df272c194ef7d7c6 to your computer and use it in GitHub Desktop.
Declarar y mostrar zonas de Widgets
// 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