Community Forums › Forums › Archived Forums › Design Tips and Tricks › Want to add more Front Page Widget areas To Author Pro
Tagged: Author Pro, front page, home page, widgets
- This topic has 5 replies, 3 voices, and was last updated 6 years, 1 month ago by authorpronewbie.
-
AuthorPosts
-
October 13, 2018 at 11:25 pm #223728authorpronewbieMember
Currently Author Pro has five front page sections where widgets can be added to be a dynamic home page. I would like to add more of these front page sections, and have seven. But I don't see how that can be customized. It seems like five is the maximum. Anyone know to add more. Thanks in advance for the help. Site is: http://www.aaronwjohnston.com
Aaron
http://www.aaronwjohnston.comOctober 14, 2018 at 2:51 am #223730Victor FontModeratorI originally wrote this article for the News Pro theme, but the process is the same for any Genesis/Studio Press theme: https://victorfont.com/add-widget-areas-to-news-pro-theme/
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?October 16, 2018 at 4:25 pm #223789authorpronewbieMemberThanks for the reply, Victor. Very kind. Your solution looks a little advanced for me, so frankly I'm afraid to try. But I will definitely investigate it further and respond back here if I can get it to work out. Thank you!
October 17, 2018 at 3:14 am #223799andytcParticipantIt's a 15 minute job , you'll need to access only 2 files in the author-pro theme DIR (not genesis dir)
www.yoursite-name/wp-content/themes/author-pro/
functions.php
front-page.phpThe line numbers assume that you haven't made any edits to these files previously, if you have just look for the code sections.
Open up functions.php
Find line 234 of function.php and right after that line add the code below on a new line (it's at the very end , there's nothing after it)
genesis_register_sidebar( array( 'id' => 'front-page-6', 'name' => __( 'Front Page 6', 'author-pro' ), 'description' => __( 'This is the front page 6 section.', 'author-pro' ), ) ); genesis_register_sidebar( array( 'id' => 'front-page-7', 'name' => __( 'Front Page 7', 'author-pro' ), 'description' => __( 'This is the front page 7 section.', 'author-pro' ), ) );
Open up front-page.php
Find line 21 of front-page.php and replace all of that code with the new code below - were just adding 2 new conditionals for 'is_active_sidebar' for our new widget areas. You can take a look and compare the 2 bits of code to see the very simple additions.
if ( is_active_sidebar( 'front-page-1' ) || is_active_sidebar( 'front-page-2' ) || is_active_sidebar( 'front-page-3' ) || is_active_sidebar( 'front-page-4' ) || is_active_sidebar( 'front-page-5' ) || is_active_sidebar( 'front-page-6' ) || is_active_sidebar( 'front-page-7' ) ) {
Find line 66 of front-page.php and add the code below right after the last genesis_widget_area (number 5) on a new line, take care NOT to remove the closing curly brace } at line 86 or the "// Run the Genesis loop .genesis();".
genesis_widget_area( 'front-page-6', array( 'before' => '<div id="front-page-6" class="front-page-6"><div class="flexible-widgets widget-area' . author_widget_area_class( 'front-page-6' ) . '">', 'after' => '</div></div>', ) ); genesis_widget_area( 'front-page-7', array( 'before' => '<div id="front-page-7" class="front-page-7"><div class="flexible-widgets widget-area' . author_widget_area_class( 'front-page-7' ) . '">', 'after' => '</div></div>', ) );
That's it , save both files and go to widgets , you'll now see your 2 new flexible widget area's. Add your content and do your own own styling if required.
October 17, 2018 at 3:19 am #223800andytcParticipantIt's a 15 minute job , you'll need to access only 2 files in the author-pro theme DIR (not genesis dir)
www.yoursite-name/wp-content/themes/author-pro/
functions.php
front-page.phpThe line numbers assume that you haven't made any edits to these files previously, if you have just look for the code sections.
Open up functions.php
Find line 234 of function.php and right after that line add the code below on a new line (it's at the very end , there's nothing after it)
genesis_register_sidebar( array( 'id' => 'front-page-6', 'name' => __( 'Front Page 6', 'author-pro' ), 'description' => __( 'This is the front page 6 section.', 'author-pro' ), ) ); genesis_register_sidebar( array( 'id' => 'front-page-7', 'name' => __( 'Front Page 7', 'author-pro' ), 'description' => __( 'This is the front page 7 section.', 'author-pro' ), ) );
Open up front-page.php
Find line 21 of front-page.php and replace all of that code with the new code below - were just adding 2 new conditionals for 'is_active_sidebar' for our new widget areas. You can take a look and compare the 2 bits of code to see the very simple additions.
if ( is_active_sidebar( 'front-page-1' ) || is_active_sidebar( 'front-page-2' ) || is_active_sidebar( 'front-page-3' ) || is_active_sidebar( 'front-page-4' ) || is_active_sidebar( 'front-page-5' ) || is_active_sidebar( 'front-page-6' ) || is_active_sidebar( 'front-page-7' ) ) {
Find line 66 of front-page.php and add the code below right after the last genesis_widget_area (number 5), take care not to remove the closing curly brace } at line 86 or the "// Run the Genesis loop .genesis();".
genesis_widget_area( 'front-page-6', array( 'before' => '<div id="front-page-6" class="front-page-6"><div class="flexible-widgets widget-area' . author_widget_area_class( 'front-page-6' ) . '">', 'after' => '</div></div>', ) ); genesis_widget_area( 'front-page-7', array( 'before' => '<div id="front-page-7" class="front-page-7"><div class="flexible-widgets widget-area' . author_widget_area_class( 'front-page-7' ) . '">', 'after' => '</div></div>', ) );
That's it , save both files and go to widgets , you'll now see your 2 new flexible widget area's. Add your content and do your own own styling if required.
October 17, 2018 at 10:06 am #223808authorpronewbieMemberHoly moly!!! This worked. Thank you, andytc. You are my hero. How kind of you to take the time to show me how to do this. Very kind. Thank you. It works perfectly!
-
AuthorPosts
- The topic ‘Want to add more Front Page Widget areas To Author Pro’ is closed to new replies.