Community Forums › Forums › Archived Forums › General Discussion › Widget Area Above Home-Top Backcountry
- This topic has 12 replies, 3 voices, and was last updated 10 years, 5 months ago by wtechrbr.
-
AuthorPosts
-
October 8, 2013 at 3:11 pm #65883wtechrbrMember
I'd like to add 2 widgets above the home-top area of the backcountry theme. Similar to the existing home-left and home-right, but I'd like them to execute them before the home-top section such that they take up the full width before the primary sidebar comes into play.
I know how to register the new widgets, but I'm not sure how to add them correctly in the home.php file as I don't see a reference to the home-top section to execute them before.
Thanks for any help you might be able to give.
October 8, 2013 at 8:16 pm #65908Brad DaltonParticipantOctober 8, 2013 at 8:52 pm #65911wtechrbrMemberSure - here you go - just getting started on it.
October 9, 2013 at 12:30 am #65922Brad DaltonParticipantOctober 9, 2013 at 10:06 am #65977wtechrbrMemberSuper helpful - thanks. Was hoping to still use the home-top widget area and was hoping the 2 new widgets would present above home-top, such that I'd have a pair of widgets (left and right), the full-width home-top, then content-sidebar.
October 9, 2013 at 10:11 am #65978wtechrbrMemberSent too fast....
I tried swapping in a variety of hook placements like genesis_after_header and genesis_before_content_sidebar_wrap but none yielded the desired result. I also tried defining a new widget area similar to home-top to be executed right after my new pair of widgets, but for some reason I had an error in my logic and couldn't get it to work. Thought maybe you would have a suggestion for the appropriate hook reference to use such that the new pair would show up prior to the already defined home-top widget area.
Much thanks for the help you've already extended to me. I very much appreciate it.
October 9, 2013 at 5:30 pm #66032Brad DaltonParticipantOctober 10, 2013 at 10:39 am #66155wtechrbrMemberHey - just got a chance to try, and it behaved the same.
home-top executed before newly defined widget areas.
It looks like it needs to be executed just after the subnav. I didn't see a specific hook for that, but maybe its possible.
Thanks again for helping so much.
October 10, 2013 at 7:25 pm #66203Brad DaltonParticipantOctober 15, 2013 at 12:49 pm #66856wtechrbrMemberHey - sorry for the lag in response.....
I'm able to get what you have in the screenshot above too. What I am trying to do is get the pre-defined "home-top" to render below my new "above-home-top-left" and "above-home-top-right" widget areas. Such that
Above-Home-Top-Left Above-Home-Top-Right
Home-Top
Home-Left Home-RightCurrently, I can only get it too render as this:
Home-Top
Above-Home-Top-Left Above-Home-Top-Right
Home-Left Home-RightThanks again for your help!
October 15, 2013 at 1:43 pm #66866SummerMemberCan you try taking the if statement for the home-top out of the function Brad gave you, and put it inside the existing home_loop_helper function, so that the new areas are called in that order in the home.php? Basically remove the add_action, and the function, but put the meat of that function in the other function, as the first if.
That way, home-top, home, and home-bottom are called in the order you need them.
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkOctober 15, 2013 at 2:25 pm #66871wtechrbrMemberI will try that - thanks for the suggestion.
I've noticed the home-top is invoked from the functions.php file rather than the home.php file. I think that might be the root of my problem. The functions.php has the following:
/** Add home top section to homepage */
add_action( 'genesis_before_content_sidebar_wrap', 'backcountry_home_top' );
function backcountry_home_top() {if ( is_front_page() && is_active_sidebar( 'home-top' ) ) {
echo '<div id="home-top">';
dynamic_sidebar( 'home-top' );
echo '</div><!-- end #home-top -->';
}}
I've been invoking my new widget areas from home.php, but maybe I should be putting them in functions.php to correctly invoke them in the order I want and in relation to home-top. Just not sure...
October 24, 2013 at 4:24 pm #68722wtechrbrMemberMoved the invocation of the home-top widget from the functions.php file to the home.php file right after the 2 newly defined widget areas.
-
AuthorPosts
- The topic ‘Widget Area Above Home-Top Backcountry’ is closed to new replies.