Community Forums › Forums › Archived Forums › Design Tips and Tricks › Add new widget area under menu
Tagged: Add Widget
- This topic has 10 replies, 4 voices, and was last updated 10 years, 7 months ago by
ToniLaird.
-
AuthorPosts
-
May 29, 2014 at 11:27 pm #107417
ToniLaird
MemberI am using the Metro Pro and was wondering if anyone could point me in the right direction to add a new widget area just under the main menu.
I'm sure there must be a link in here somewhere 😉
http://www.tonipress.com/May 29, 2014 at 11:50 pm #107421Brad Dalton
ParticipantUse the genesis_after_header hook and remove the conditional tag of needed.
May 29, 2014 at 11:52 pm #107422Davinder Singh Kainth
MemberBackup before making changes.
Adds new widget under header / menu area and is visible on all pages
/** Add new widget under header on homepage in Genesis theme */ genesis_register_sidebar( array( 'id' => 'homepage-feature', 'name' => __( 'Homepage Feature', 'custom' ), 'description' => __( 'This is Homepage feature section', 'custom' ), ) ); /** Top Homepage feature section */ add_action( 'genesis_after_header', 'news_homepage_feature', 16 ); function news_homepage_feature() { echo '<div class="homepage-feature">'; dynamic_sidebar( 'homepage-feature' ); echo '</div><!-- end .homepage-feature -->'; }
Refer - http://www.basicwp.com/add-new-widget-genesis-homepage/
Above tutorial adds new widget only on homepage.
Sunshine PRO genesis theme
Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis ThemesMay 30, 2014 at 12:02 am #107423JanHoek
ParticipantDid not refresh my browser before I posted a answer. You Already got some help I see. Sorry.
Hi, my name is Jan Hoek. Sure, they all say I have a big head, but I like to think it’s way too small for all my ideas.
May 30, 2014 at 1:43 am #107439ToniLaird
MemberThanks everyone for your great support. I see different options here and don't know which I should use. To be honest I'd like to add the extra widget space on the homepage only which is a static page.
May 30, 2014 at 3:22 am #107444ToniLaird
MemberBoth options work but the code from Brad gives my the image on the static home page only. Thank you both again. Perhaps one last question:
I placed an image in this widget which is flush with the menu. I'd like to add some space. What should I place in the style css?
Thanks again
May 30, 2014 at 4:59 am #107450Brad Dalton
ParticipantMay 30, 2014 at 10:44 pm #107578ToniLaird
MemberThanks Brad
This is what I added although changing the colour to white appears the padding is already there and looks as I wanted. By the way, I subscribed to your sites.
.home-feature {
background:#fff;
margin:0 auto;
position: relative
}Regards
Toni
May 31, 2014 at 1:37 am #107593Brad Dalton
ParticipantJune 20, 2014 at 6:50 am #107449Brad Dalton
ParticipantJune 29, 2014 at 9:58 am #111977ToniLaird
MemberPerhaps I closed this post too soon! I added the same code to my live site and the widget shows up in the admin widgets section but nothing displays on the front page. Any ideas?
genesis_register_sidebar( array(
'id' => 'home-feature',
'name' => __( 'Home Feature', 'domain' ),
'description' => __( 'Add Content Here', 'domain' ),
) );add_action( 'genesis_after_header', 'home-feature' );
function your_widget() {
if ( is_front_page() && is_active_sidebar('home-feature') ) {
genesis_widget_area( 'home-feature', array(
'before' => '<div class="home-feature home-feature">',
'after' => '</div>',
) );
}
}
-
AuthorPosts
- The topic ‘Add new widget area under menu’ is closed to new replies.