added new widget area. renamed general widget areas. aplly general widget areas to page templates

This commit is contained in:
jorge 2024-03-31 16:20:10 +02:00
parent db32cad184
commit 3ad6632cc6
5 changed files with 31 additions and 10 deletions

View File

@ -7,7 +7,7 @@
function xarxaprod_widgets_init() {
register_sidebar(
array(
'name' => esc_html__( 'Front Page - principal', 'xarxaprod' ),
'name' => esc_html__( 'Front Page - Despres del contingut a la Pagina principal', 'xarxaprod' ),
'id' => 'front-page-widgets',
'description' => esc_html__( 'Add widgets here.', 'xarxaprod' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
@ -18,8 +18,8 @@
);
register_sidebar(
array(
'name' => esc_html__( 'Sidebar funds - Lateral ajuts', 'xarxaprod' ),
'id' => 'sidebar-funds',
'name' => esc_html__( 'After content - Despres del contingut i abans del peu. A tota la web.', 'xarxaprod' ),
'id' => 'after-content',
'description' => esc_html__( 'Add widgets here.', 'xarxaprod' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
@ -29,7 +29,18 @@
);
register_sidebar(
array(
'name' => esc_html__( 'Footer - Peu', 'xarxaprod' ),
'name' => esc_html__( 'After Associats - Despres del contingut als Espais Associats i abans del peu', 'xarxaprod' ),
'id' => 'after-content-members',
'description' => esc_html__( 'Add widgets here.', 'xarxaprod' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer - Peu de página', 'xarxaprod' ),
'id' => 'footer-widgets',
'description' => esc_html__( 'Add widgets here.', 'xarxaprod' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',

View File

@ -88,6 +88,15 @@ get_header();
</section>
</main><!-- #main -->
<?php
if ( ! is_active_sidebar( 'after-content-members' ) ) {
return;
} else {?>
<aside id="secondary" class="widget-area widget-area-members">
<?php dynamic_sidebar( 'after-content-members' ); ?>
</aside><!-- #secondary -->
<?php }; //end else ?>
<?php
get_sidebar();
get_footer();

View File

@ -73,4 +73,5 @@ get_header();
</main><!-- #main -->
<?php
get_sidebar();
get_footer();

View File

@ -7,11 +7,11 @@
* @package Xarxaprod_theme
*/
if ( ! is_active_sidebar( 'sidebar-funds' ) ) {
if ( ! is_active_sidebar( 'after-content' ) ) {
return;
}
?>
<aside id="secondary" class="widget-area">
<?php dynamic_sidebar( 'sidebar-funds' ); ?>
<?php dynamic_sidebar( 'after-content' ); ?>
</aside><!-- #secondary -->