content in new widget areas no displaying

Community Forums Forums Design Tips and Tricks content in new widget areas no displaying

This topic is: not resolved

This topic contains 14 replies, has 3 voices, and was last updated by  braddalton 1 year, 4 months ago.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #50761

    Elaine Griffin
    Participant
    Post count: 86

    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
    #50767

    AC
    Blocked
    Post count: 7712

    Try changing this from is_front_page to is_home.

    #50768

    braddalton
    Participant
    Post count: 10568

    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.


    #50777

    Elaine Griffin
    Participant
    Post count: 86

    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!

    #50786

    braddalton
    Participant
    Post count: 10568

    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


    #50804

    Elaine Griffin
    Participant
    Post count: 86

    Awesome, thank you so much!

    #50927

    Elaine Griffin
    Participant
    Post count: 86

    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

    #50929

    braddalton
    Participant
    Post count: 10568

    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.


    #50930

    Elaine Griffin
    Participant
    Post count: 86

    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.

    #50931

    braddalton
    Participant
    Post count: 10568

    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.


    #50932

    Elaine Griffin
    Participant
    Post count: 86

    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.

    #50933

    braddalton
    Participant
    Post count: 10568

    Should work, Try changing the conditional tag to page-id-1837
    [php]
    if ( is_page(1837) && is_active_sidebar( ‘kitchen-widget’ ) ) {
    [/php]


    #50934

    Elaine Griffin
    Participant
    Post count: 86

    No, still nothing. This is crazy!

    #50939

    Elaine Griffin
    Participant
    Post count: 86

    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. :(

    #50949

    braddalton
    Participant
    Post count: 10568

    Send me the child themes functions.php files for the sites it isn’t working on please: brad@wpsites.net


Viewing 15 posts - 1 through 15 (of 15 total)

You must be logged in to reply to this topic.