Created
July 20, 2018 15:39
-
-
Save tavomak/bd28394b08e290fedfd94014eba455c5 to your computer and use it in GitHub Desktop.
Registrar y mostrar widgets en wp
This file contains hidden or 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
//REGISTRO EN FUNCTIONS.PHP | |
function a_pr_widgets_init() { | |
/* | |
Sidebar regular (un widget area) | |
*/ | |
register_sidebar( array( | |
'name' => __( 'Sidebar', 'a-pr' ), | |
'id' => 'sidebar-widget-area', | |
'description' => __( 'Sidebar widget Articulos', 'a-pr' ), | |
'before_widget' => '<section class="%1$s %2$s">', | |
'after_widget' => '</section>', | |
'before_title' => '<h4>', | |
'after_title' => '</h4>', | |
) ); | |
/* | |
Sidebar solo para la pagina de todos los blogs (three widget areas) | |
*/ | |
register_sidebar( array( | |
'name' => __( 'Sidebar All Post', 'a-pr' ), | |
'id' => 'article-widget-area', | |
'description' => __( 'Sidebar widget All post', 'a-pr' ), | |
'before_widget' => '<section class="%1$s %2$s">', | |
'after_widget' => '</section>', | |
'before_title' => '<h4>', | |
'after_title' => '</h4>', | |
) ); | |
} | |
add_action( 'widgets_init', 'a_pr_widgets_init' ); | |
/*INCLUIR EN EL THEME <?php dynamic_sidebar('sidebar-widget-area'); ?>*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment