• 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

PHP Help – widget areas not visible on site

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 › General Discussion › PHP Help – widget areas not visible on site

This topic is: resolved

Tagged: front-page.php

  • This topic has 1 reply, 2 voices, and was last updated 8 years, 3 months ago by Susan.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • February 3, 2015 at 10:48 pm #139601
    dahlkr
    Member

    Hi can somebody help with the PHP code here. I added a left and right Home Middle Widget to Outreach below the Home Top Widget. They are there on my widgets page so I did part of it correctly but they are not visible on my site so I assume I do not have the front-page.php code right. Thank you, thank you.

    this is what I have:

    add_action( 'genesis_meta', 'outreach_home_genesis_meta' );
    /**
    * Add widget support for homepage. If no widgets active, display the default loop.
    *
    */
    function outreach_home_genesis_meta() {

    if ( is_active_sidebar( 'home-top' ) || is_active_sidebar( 'home-middle' ) || is_active_sidebar( 'home-bottom' ) ) {

    //* Force full-width-content layout setting
    add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );

    //* Add outreach-pro-home body class
    add_filter( 'body_class', 'outreach_body_class' );

    //* Remove breadcrumbs
    remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );

    //* Remove the default Genesis loop
    remove_action( 'genesis_loop', 'genesis_do_loop' );

    //* Add home top widgets
    add_action( 'genesis_loop', 'outreach_home_top_widgets' );

    //* Add home bottom widgets
    add_action( 'genesis_before_footer', 'outreach_home_bottom_widgets', 1 );

    }

    }

    function outreach_body_class( $classes ) {

    $classes[] = 'outreach-pro-home';
    return $classes;

    }

    function outreach_home_top_widgets() {

    genesis_widget_area( 'home-top', array(
    'before' => '<div class="home-top widget-area">',
    'after' => '</div>',
    ) );

    }

    function outreach_home_middle_widgets() {

    if ( is_active_sidebar( 'home-middle-left' ) || is_active_sidebar( 'home-middle-right' ) ) {
    echo '<div class="home-middle"><div class="wrap">';

    genesis_widget_area( 'home-middle-left', array(
    'before' => '<div class="home-middle-left">',
    'after' => '</div>',
    ) );

    genesis_widget_area( 'home-middle-right', array(
    'before' => '<div class="home-middle-right">',
    'after' => '</div>',
    ) );

    echo '</div><!-- end .wrap --></div><!-- end .home-middle -->';
    }

    }

    function outreach_home_bottom_widgets() {

    genesis_widget_area( 'home-bottom', array(
    'before' => '<div class="home-bottom widget-area"><div class="wrap">',
    'after' => '</div></div>',
    ) );

    }

    genesis();

    http://reddoordesigncompany.com/maximize
    March 6, 2015 at 3:23 pm #143503
    Susan
    Moderator

    I will close this, as you have marked it "resolved". If you are still having issues, please go ahead and start a new thread.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘PHP Help – widget areas not visible on site’ 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

© 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