Additional widget areas
-
Since we don’t use a sidebar I’d love to add some additional widget areas to the site. I downloaded the child theme and added the following code to the functions.php. Is it correct? Next step would be to implement these areas where they are supposed to be, would you (or any forum user here?) help me with this?
if ( ! function_exists( ( 'ct_startup_blog_register_widget_areas' ) ) ) { function ct_startup_blog_register_widget_areas() { register_sidebar( array( 'name' => 'Custom Before Content', 'id' => 'custom-before-content', 'description' => 'Widgets in this area will be shown before main content', 'before_widget' => '<section class="custom-before-content">', 'after_widget' => '</section>', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>' ) ); register_sidebar( array( 'name' => 'Custom After Content', 'id' => 'custom-after-content', 'description' => 'Widgets in this area will be shown after main content.', 'before_widget' => '<section class="custom-after-content">', 'after_widget' => '</section>', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>' ) ); register_sidebar( array( 'name' => 'Custom Footer', 'id' => 'custom-footer', 'description' => 'Widgets in this area will be shown in the footer.', 'before_widget' => '<section class="custom-footer">', 'after_widget' => '</section>', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>' ) ); } } add_action( 'widgets_init', 'ct_startup_blog_register_widget_areas' );
The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Additional widget areas’ is closed to new replies.