• 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

content in new widget areas no displaying

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 › content in new widget areas no displaying

This topic is: not resolved

Tagged: sidebars, Simple Hooks, widget areas

  • This topic has 14 replies, 3 voices, and was last updated 9 years, 8 months ago by Brad Dalton.
Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • July 15, 2013 at 6:30 am #50761
    Elaine Griffin
    Member

    Hi,
    I cannot for the life of me get my content to display in new widget areas. I want them only to show on the homepage, so I'm using widget logic and using this conditional:
    is_front_page()
    I have also tried using is_page( 'home' )
    I have this added to genesis_post_content in simple hooks:
    <div class="slider-sidebar">
    <?php dynamic_sidebar( 'slider-sidebar' ); ?>
    </div>
    <div class="kitchen-widget">
    <?php dynamic_sidebar( 'kitchen-widget' ); ?>
    </div>
    <div class="craft-widget">
    <?php dynamic_sidebar( 'craft-widget' ); ?>
    </div>
    <div class="shop-widget">
    <?php dynamic_sidebar( 'shop-widget' ); ?>
    </div>
    <div class="latest-post-widget">
    <?php dynamic_sidebar( 'latest-post-widget' ); ?>
    </div>
    <div class="about-widget">
    <?php dynamic_sidebar( 'about-widget' ); ?>
    </div>
    I'm so frustrated by this, and I would appreciate any help.
    FYI, the information that is displaying was code added to the actual home page by the previous designer.
    Thanks!

    http://www.aimeebroussard.com
    July 15, 2013 at 6:49 am #50767
    Anita
    Keymaster

    Try changing this from is_front_page to is_home.


    Love coffee, chocolate and my Bella!

    July 15, 2013 at 6:58 am #50768
    Brad Dalton
    Participant

    In my opinion, an easier and better way to do this to to add custom functions which both register the new widgets and hook them into position using your child themes functions.php file:

    Here's an example:

    Rinse and repeat as they say.

    is_front_page should be used when not using the default settings for front page meaning you have selected a static page as your home page.

    is_home should be used when using the default home page when Display latest posts is selected in your reading settings.

    Another option is to use a home.php file from another theme and modify it.


    Tutorials for StudioPress Themes.

    July 15, 2013 at 7:55 am #50777
    Elaine Griffin
    Member

    Thanks anitac. I did try that, and it didn't work. Plus, it is a static landing page.

    Brad, thanks so much. I just ran across similar code this morning and thought I would like to try this out. I'm going to give it a try.
    Can I ask, though, what is the "5" for on line 10?
    Thanks!

    July 15, 2013 at 8:53 am #50786
    Brad Dalton
    Participant

    5 is the 3rd parameter for positioning priority.

    You could use the same hook and use different priority numbers to determine which widget outputs first and in which order.

    So you could use 15 for the second widget which is kitchen:

    $priority
    (integer) (optional) Used to specify the order in which the functions associated with a particular action are executed. Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order in which they were added to the action.

    Default: 10

    Source: WordPress Codex


    Tutorials for StudioPress Themes.

    July 15, 2013 at 11:13 am #50804
    Elaine Griffin
    Member

    Awesome, thank you so much!

    July 16, 2013 at 2:46 am #50927
    Elaine Griffin
    Member

    Okay, I used the code on another site I'm working on, and it displayed just fine. I am using it on the original site I asked about, and none of the content is displaying.
    I have tried adding the code to both functions.php, and home.php, and I have the same outcome.
    Thanks!
    http://www.aimeebroussard.com

    July 16, 2013 at 3:53 am #50929
    Brad Dalton
    Participant

    The code will only work in functions, not in your home.php file. If you copy it from the view raw link and paste it using a code editor at the end of your child themes functions.php file, it works.


    Tutorials for StudioPress Themes.

    July 16, 2013 at 3:55 am #50930
    Elaine Griffin
    Member

    The funny thing is the widgets are there in the dashboard, and I have added the text content/plugins, but it's not showing on the actual page.

    July 16, 2013 at 4:00 am #50931
    Brad Dalton
    Participant

    What page?

    is_front_page should be used when not using the default settings for front page meaning you have selected a static page as your home page.

    is_home should be used when using the default home page when Display latest posts is selected in your reading settings.


    Tutorials for StudioPress Themes.

    July 16, 2013 at 4:04 am #50932
    Elaine Griffin
    Member

    Yep, it's set up as a landing page with the page called "home" as the front static page.
    The information that is in there now is some HTML inserted by the former designer, and it's inserted directly into the page.

    July 16, 2013 at 4:10 am #50933
    Brad Dalton
    Participant

    Should work, Try changing the conditional tag to page-id-1837

    if ( is_page(1837) && is_active_sidebar( 'kitchen-widget' ) ) {
    

    Tutorials for StudioPress Themes.

    July 16, 2013 at 4:30 am #50934
    Elaine Griffin
    Member

    No, still nothing. This is crazy!

    July 16, 2013 at 7:59 am #50939
    Elaine Griffin
    Member

    I am trying this on another site, and it's not working there, either. So, out of three, one works, and one doesn't. I can't figure out what I've done. 🙁

    July 16, 2013 at 9:57 am #50949
    Brad Dalton
    Participant

    Send me the child themes functions.php files for the sites it isn't working on please: [email protected]


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 15 posts - 1 through 15 (of 15 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