Community Forums › Forums › Archived Forums › Design Tips and Tricks › Adding Full-Width Widget Area to Magazine Pro
- This topic has 12 replies, 5 voices, and was last updated 9 years, 8 months ago by smkyle1.
-
AuthorPosts
-
July 2, 2014 at 8:17 pm #112755[email protected]Member
Hi folks;
As much as the next guy hates being the ones to ask a repeat question, I can say that I *did* look around first to see if I could find the answer.
A burning desire to get my real estate website looking EXACTLY how I want lately has lead me to learn a lot more about CSS. I am still stumped on this one though. I am using Magazine Pro, and I want to add a widget area above the Home Top area, but below the navigation to basically put a full-width slider in.
I found the following code and have attempted to use it, but it freezes my entire wp-admin back panel. I have been successful in changing pre-existing code thus far, and finding what I need in the depths, but adding this code has not turned out well. Any advice is immensely appreciated!
http://www.alexanderhendrickson.comgenesis_register_sidebar( array( 'id' => 'before-home', 'name' => __( 'Home Before Content', 'wpsites' ), 'description' => __( 'Displays Before Content On Home Page.', 'wpsites' ), ) ); /** * @author Brad Dalton * @example http://wpsites.net/web-design/add-widget-area-before-content/ * @copyright 2014 WP Sites */ add_action( 'genesis_before_content', 'wpsites_widget_before_home' ); function wpsites_widget_before_home() { if ( is_home() && is_active_sidebar('before-content') ) { genesis_widget_area( 'before-home', array( 'before' => '<div class="before-home" class="widget-area">', 'after' => '</div>', ) ); } }
July 2, 2014 at 9:28 pm #112757Brad DaltonParticipantJuly 2, 2014 at 9:46 pm #112766[email protected]MemberAm I missing something? The Magazine Pro code, or the code I posted? The link (http://wpsites.net/web-design/add-widget-area-before-content/) is right in the middle OF the code. In fact it is your code. I posted that because I believed from what I know that it should affect my desired result, but it doesn't.
Thanks!
July 2, 2014 at 9:58 pm #112768Brad DaltonParticipantPlease copy ALL the code from the view raw link in the Gist and paste it at the end of your child themes functions.php file using a text editor like Notepad++
I tested this code and it works.
July 2, 2014 at 10:20 pm #112773[email protected]MemberJust did that and now it works too. Was I missing something before? I thought I had copied all of it. Not sure what is different now.
Thank you!
July 2, 2014 at 10:25 pm #112774Brad DaltonParticipantI changed one of the conditional checks. is_active_sidebar('before-home')
July 5, 2014 at 6:38 am #113036Blenda YáñezParticipantHi Braddalton
I subscribe to your newsletter a few days ago but I can not access your site. Only the homepage is available in Brazil. You know that? Why can not I login? when the following message appears: " Sorry but this content is not available in your country at the moment"
I'm sorry because I like to learn from your tutorials and use his teachings to improve my site.
July 5, 2014 at 11:54 pm #113114Brad DaltonParticipantAugust 7, 2014 at 4:43 pm #117665wasanajonesMemberthanks Brad - I had strayed away from genesis following the lure of easy layouts... but now I know nothing beats the support found here
August 7, 2014 at 7:43 pm #117684Brad DaltonParticipantUnderstand, Its hard to get top quality support for free from unpaid forum volunteers.
August 7, 2014 at 11:05 pm #117706smkyle1MemberBrad,
I tried the code you wrote for Alexander on my Metro Pro child theme and it worked great. I would like to do something similar but I want my widget to be positioned at the very top of the page - above my header and I'd like it centered.
Here is my site:
thanks so much,
Sharon
August 7, 2014 at 11:24 pm #117709Brad DaltonParticipantChange the genesis_before_content hook to wp_head or genesis_before_header and then use CSS to center your content.
Note: All functions and widgets need to use unique names and I.D's
August 8, 2014 at 12:52 pm #117802smkyle1Memberthank you so much -- you've saved me a lot of time
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.