• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Can't display registered widget in Genesis Sample

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Can't display registered widget in Genesis Sample

This topic is: resolved

Tagged: genesis sample, widgets

  • This topic has 1 reply, 2 voices, and was last updated 10 years, 3 months ago by Susan.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • April 17, 2015 at 3:34 pm #148280
    mairagall
    Member

    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 #148323
    Susan
    Moderator

    I am closing this as you have marked it "resolved". Please start a new thread if you are still having issues.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Can't display registered widget in Genesis Sample’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble