Community Forums › Forums › Archived Forums › Design Tips and Tricks › Cannot add extra widget area on home page
Tagged: widget areas
- This topic has 1 reply, 1 voice, and was last updated 5 years, 11 months ago by
rogerp.
-
AuthorPosts
-
May 1, 2020 at 8:40 am #498351
rogerp
ParticipantI am trying to add an extra widget on the home page, which I managed to do one but cannot get a second one to work. the one I can't get to work is front-page-4-a
functions.php
//* Add Front Page Template widget areas
genesis_register_sidebar( array(
'id' => 'front-page-1',
'name' => __( 'Front Page 1', 'smart-passive-income-pro' ),
'description' => __( 'The first section on the front page.', 'smart-passive-income-pro' ),
));
genesis_register_sidebar( array(
'id' => 'front-page-2',
'name' => __( 'Front Page 2', 'smart-passive-income-pro' ),
'description' => __( 'The second section on the front page.', 'smart-passive-income-pro' ),
));
genesis_register_sidebar( array(
'id' => 'front-page-3-a',
'name' => __( 'Front Page 3 - Top', 'smart-passive-income-pro' ),
'description' => __( 'The top half of the third section on the front page.', 'smart-passive-income-pro' ),
));
genesis_register_sidebar( array(
'id' => 'front-page-3-aa',
'name' => __( 'Front Page 3 - Top2', 'smart-passive-income-pro' ),
'description' => __( 'The first section on the front page.', 'smart-passive-income-pro' ),
));
genesis_register_sidebar( array(
'id' => 'front-page-4-a',
'name' => __( 'Front Page 4 Top', 'smart-passive-income-pro' ),
'description' => __( 'The fourth section on the front page.', 'smart-passive-income-pro' ),front-page.php
//* Function to initiate widgetized page render
add_action( 'genesis_meta', 'spi_front_page_init' );
function spi_front_page_init() {if ( is_active_sidebar( 'front-page-1' ) || is_active_sidebar( 'front-page-2' ) || is_active_sidebar( 'front-page-3-a' ) || is_active_sidebar( 'front-page-3-aa' ) || is_active_sidebar( 'front-page-4-a' ) || is_active_sidebar( 'front-page-3-b' ) || is_active_sidebar( 'front-page-4' ) ) {
I just want to duplicate a widget area on the home page -
It shows in the widget area and I can drag widgets into it but they do not render on the home page?
Thanks
https://www.rogerperkin.co.uk/Roger
https://www.rogerperkin.co.uk/
Check out my Network Automation Training – Training the Network Engineers of the FutureMay 1, 2020 at 8:47 am #498352rogerp
ParticipantI have found the problem, I had not added the extra code to
front-page.php
//* Function to output active widget areas
function spi_home_widget_loop() {Extra widget is working now
Roger
https://www.rogerperkin.co.uk/
Check out my Network Automation Training – Training the Network Engineers of the Future -
AuthorPosts
- The topic ‘Cannot add extra widget area on home page’ is closed to new replies.