Community Forums › Forums › Archived Forums › Design Tips and Tricks › Can't display registered widget in Genesis Sample
Tagged: genesis sample, widgets
- This topic has 1 reply, 2 voices, and was last updated 9 years ago by Susan.
-
AuthorPosts
-
April 17, 2015 at 3:34 pm #148280mairagallMember
Hi guys, I need some help.
I want to display a different image in each page, this images must be placed below the header of my website (currently in maintenance mode), I followed this Sridhar tutorial succesfully to create a widgetized front page. Now I need to add one widgetized area below the header in the rest of the pages, and I need to display a different image widget in each page.
I tried several tutorials from Sridhar, and this one from Carrie Dils, the widgets are registered but they don't display in the pages...right now I have this code in function.php
/** Register widget areas */ genesis_register_sidebar( array( 'id' => 'cta-1', 'name' => __( 'Call to Action #1', 'mp' ), 'description' => __( 'This is the call to action section.', 'mp' ), ) ); genesis_register_sidebar( array( 'id' => 'cta-2', 'name' => __( 'Call to Action #2', 'mp' ), 'description' => __( 'This is the call to action section.', 'mp' ), ) ); genesis_register_sidebar( array( 'id' => 'cta-3', 'name' => __( 'Call to Action #3', 'mp' ), 'description' => __( 'This is the call to action section.', 'mp' ), ) ); genesis_register_sidebar( array( 'id' => 'cta-4', 'name' => __( 'Call to Action #4', 'mp' ), 'description' => __( 'This is the call to action section.', 'mp' ), ) ); add_action( 'genesis_after_header', 'mp_cta_genesis' ); /** * Add CTA widget support for site. If widget not active, don't display * */ function mp_cta_genesis() { // Don't display the CTA on the home page, since it's built into the MP theme if ( is_home() ) { return; } // If it's the Shop page, display CTA #1 elseif ( is_page( 'shop' ) ) { genesis_widget_area( 'cta-1', array( 'before' => '<div id="cta"><div class="wrap">', 'after' => '</div></div>', ) ); } // If it's a page with ID 101 or 102 or any page within my Portfolio CPT // Display CTA #2 elseif ( is_page( array(101,102) ) || ('portfolio' == get_post_type() ) ) { genesis_widget_area( 'cta-2', array( 'before' => '<div id="cta"><div class="wrap">', 'after' => '</div></div>', ) ); } // If it's the Contact page, display CTA #3 elseif ( is_page('contact') ) { genesis_widget_area( 'cta-3', array( 'before' => '<div id="cta"><div class="wrap">', 'after' => '</div></div>', ) ); } // If all else fails and none of the above conditions are met, display CTA #4 else { genesis_widget_area( 'cta-4', array( 'before' => '<div id="cta"><div id="enews" class="wrap">', 'after' => '</div></div>', ) ); } }
I only changed the conditional for my shop page, and nothing is showing up...
I appreciate any help or ideas...
April 18, 2015 at 5:55 am #148323SusanModeratorI am closing this as you have marked it "resolved". Please start a new thread if you are still having issues.
-
AuthorPosts
- The topic ‘Can't display registered widget in Genesis Sample’ is closed to new replies.