Community Forums › Forums › Archived Forums › General Discussion › Altitude Pro: add widget area to home page and one other page only
Tagged: Altitude Pro
- This topic has 6 replies, 2 voices, and was last updated 8 years, 11 months ago by
MissKitty.
-
AuthorPosts
-
November 6, 2017 at 10:42 am #213320
MissKitty
ParticipantI'm trying to register and display a widget area on the home page and contact page of my client's site. I can get it to display on the contact page just fine, but not on the home page.
The link to my dev site link is here (please forgive the rudimentary stage it's in).
My functions.php code:
//* register testimonials widget jlr genesis_register_sidebar( array( 'id' => 'testimonials-widget', 'name' => __( 'Testimonials Widget', 'altitude-pro' ), 'description' => __( 'This is the testimonials widget area for home and contact page.', 'altitude-pro' ), ) ); //* Add the page widget in the content - HTML5 add_action( 'genesis_entry_footer', 'mwi_add_testimonials' ); function mwi_add_testimonials() { if ( is_home() || is_front_page() || is_page(‘703’) ) genesis_widget_area ('testimonials-widget', array( 'before' => '<div class="testimonials-widget"><div class="wrap">', 'after' => '</div></div>', ) ); }Any help would be greatly appreciated, and well worth the cost of a few cups of coffee donated via Paypal 🙂
Thanks in advance.
http://mwi.dev.onpressidium.comNovember 6, 2017 at 10:51 am #213323Brad Dalton
ParticipantNovember 6, 2017 at 10:56 am #213325MissKitty
ParticipantSo I must have mucked something up?
November 6, 2017 at 11:00 am #213326Brad Dalton
ParticipantNo. You are using a custom front page template which includes widget areas. The code only works when using the loop so you'll need to modify it.
Where did you want the widget to output on the front page?
November 6, 2017 at 12:01 pm #213329MissKitty
ParticipantI wanted it just before the footer, so it sits flush up against the footer and is full-width (I tried using the genesis_before_footer hook but it didn't work).
Here are two screenshots showing, I hope, what I'm trying to accomplish:
November 7, 2017 at 11:13 am #213361Brad Dalton
ParticipantNovember 7, 2017 at 11:25 am #213362MissKitty
ParticipantHi Brad,
Good timing! I was just about to post here that I got it to work 🙂//* register testimonials widget jlr genesis_register_sidebar( array( 'id' => 'testimonials-widget', 'name' => __( 'Testimonials Widget', 'altitude-pro' ), 'description' => __( 'This is the testimonials widget area for home and contact page.', 'altitude-pro' ), ) ); //* Add the page widget in the content - HTML5 add_action( 'genesis_before_footer', 'mwi_add_testimonials', 1 );//'genesis_entry_footer', function mwi_add_testimonials() { if ( is_home() || is_front_page() || is_page('get-in-touch') )//is_page('703') genesis_widget_area ('testimonials-widget', array( 'before' => '<div class="testimonials-widget"><div class="wrap">', 'after' => '</div></div>', ) ); } -
AuthorPosts
- The topic ‘Altitude Pro: add widget area to home page and one other page only’ is closed to new replies.