• 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

Centric – would like two home widgets to show up on all pages

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 › Centric – would like two home widgets to show up on all pages

This topic is: not resolved
  • This topic has 2 replies, 2 voices, and was last updated 5 years, 10 months ago by glenkg.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • July 17, 2017 at 4:27 am #209202
    glenkg
    Participant

    The Home widgets only shows up on the home pages, logically.

    I used this code to make it show up on all the other pages but the home pages (so it would not be double):

    add_action( 'genesis_before_footer', 'centric_home2_widgets', 5 ); 
    
    function centric_home2_widgets () {
    if ( !is_front_page() && is_active_sidebar( 'home-widgets-5' ) || is_active_sidebar( 'home-widgets-6' )): 
    	genesis_widget_area( 'home-widgets-5', array(
    		'before' => '<div class="home-widgets-5 widget-area">',
    		'after'  => '</div>',
    	) );
    	genesis_widget_area( 'home-widgets-6', array(
    		'before' => '<div class="home-widgets-6 widget-area">',
    		'after'  => '</div>',
    	) );
    endif;
    }	

    It does show up double though.. so probably this is off or am I missing something else?

    if ( !is_front_page() && is_active_sidebar( 'home-widgets-5' ) || is_active_sidebar( 'home-widgets-6' )):

    Could someone help me out? Would be appreciated.

    July 17, 2017 at 5:07 am #209203
    Victor Font
    Moderator

    You should add !is_home() in your condition. is_front_page() returns true if the user is on a custom front page as set in Settings->Reading->Front page displays. is_home() returns true when using a Genesis widgetized home page. I generally use both in my conditionals:

    ! ( is_front_page() || is_home() )


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    July 24, 2017 at 6:08 am #209522
    glenkg
    Participant

    Aha, thanks Victor.

    So this will do the trick then:

    ! ( is_front_page() || is_home() ) && is_active_sidebar( 'home-widgets-5' ) || is_active_sidebar( 'home-widgets-6' )):

    Thank you again and have a nice day!

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 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