Community Forums › Forums › Archived Forums › Design Tips and Tricks › Education Pro new widget area
Tagged: education pro, New Widget Area
- This topic has 4 replies, 2 voices, and was last updated 9 years, 7 months ago by Tim Squires.
-
AuthorPosts
-
February 2, 2015 at 5:17 am #139369Tim SquiresMember
Hi,
I have created a new widget area in the Education Pro theme.The nearest hook to where I need it to be seems to be 'after-header'
But I need it to appear on the front page between the home top widget area and the home middle widget area.
I have placed a calendar in the widget area that I have created so you can see it easily.
The code that I placed in functions.php is this:
//* Register after header widget area genesis_register_sidebar( array( 'id' => 'after-header', 'name' => __( 'After Header', 'education' ), 'description' => __( 'This is the after header widget area.', 'education' ), ) ); //* Hook after header widget area before content add_action( 'genesis_after_header', 'bg_after_header_widget_area' ); function bg_after_header_widget_area() { genesis_widget_area( 'after-header', array( 'before' => '<div class="after-header widget-area"><div class="wrap">', 'after' => '</div></div>', ) ); }
Does anyone know how to make my new widget area display between home top and home middle? Is there a hook that I have missed?
Many thanks,
TimMy site is here;
http://www.timsquires.com.au/sandbox/
http://www.timsquires.com.au/sandbox/February 2, 2015 at 7:35 am #139386CarloMemberHi Tim. Remove the hook from your theme functions and move the call to
genesis_widget_area
into the template front-page.php, between the calls togenesis_widget_area
for'home-top
and'home-middle'
(I think it's line 63?)
February 2, 2015 at 4:39 pm #139452Tim SquiresMemberHi Carlo,
Thanks for your reply.I've found the correct place to place the code in frontpage.php, but I must be pasting the wrong code as it isn't working.
Do I remove the whole block of code from functions.php, or just a section of it? (sorry, I'm not sure of the difference between the 'hook' and the 'call')
I've tried a few combinations, but no luck.
Many thanks for your help!
Tim
February 3, 2015 at 4:19 am #139496Tim SquiresMemberHi again Carlo,
Thanks for your help — I've figured it out now and it works perfectly.For anyone following, in my functions.php I have this;
//* Register after header widget area genesis_register_sidebar( array( 'id' => 'after-header', 'name' => __( 'After Header', 'education' ), 'description' => __( 'This is the after header widget area.', 'education' ), ) );
...and in my front-page.php I have this:
function education_home_top_widgets() { genesis_widget_area( 'home-featured', array( 'before' => '<div class="home-featured widget-area">', 'after' => '</div>', ) ); genesis_widget_area( 'home-top', array( 'before' => '<div class="home-top widget-area"><div class="wrap">', 'after' => '</div></div>', ) ); genesis_widget_area( 'after-header', array( 'before' => '<div class="after-header widget-area"><div class="wrap">', 'after' => '</div></div>', ) ); genesis_widget_area( 'home-middle', array( 'before' => '<div class="home-middle widget-area"><div class="wrap">', 'after' => '</div></div>', ) ); }
Thanks again, Carlo
Tim
February 3, 2015 at 4:22 am #139497Tim SquiresMemberPS: Just noticed that my indents are a bit sloppy, and I will change the name of the widget to better reflect where it appears on the page. But at least it's working 🙂
Tim
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.