Adding new widget area (Agency Theme)

Community Forums Forums Design Tips and Tricks Adding new widget area (Agency Theme)

This topic is: not resolved

This topic contains 8 replies, has 5 voices, and was last updated by  matryx 1 year, 4 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #368

    halestorm
    Participant
    Post count: 3

    Hello,

    I’m trying to add a new widget area in the Agency Theme. I’m not very well versed in PHP so I’m not 100% sure what to do.

    I did the functions thing. It’s in the widget area. All good.

    But it’s not displaying on the home page the way I want it.

    I want it to appear under the 3 home left, center, and right area in it’s own bubble.

    Here is how I have the code in home.php:
    function agency_home_loop_helper() {

    if ( is_active_sidebar( 'home-left' ) || is_active_sidebar( 'home-middle' ) || is_active_sidebar( 'home-right' ) ) {

    echo '<div id="home">';

    echo '<div>';

    dynamic_sidebar( 'home-left' );

    echo '</div><!-- end .home-left -->';

    echo '<div>';

    dynamic_sidebar( 'home-middle' );

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

    echo '<div>';

    dynamic_sidebar( 'home-right' );

    echo '</div><!-- end .home-right -->';

    echo '</div><!-- end #home -->';

    }

    if ( is_active_sidebar( 'home-banner' ) ) {

    echo '<div id="home-banner">';

    dynamic_sidebar( 'home-banner' );

    echo '</div><!-- end #home-banner -->';

    }
    }

     

     

     

    So the way it’s displaying now is the widget I’m trying to add is INSIDE the bubble that the 3 other widgets are.

    I want it outside that bubble just under it. I’m thinking I need to add another function agency_home_loop_helper() type call but I have no idea what. I’m sure it’s something simple I’m missing..

    Any help would be great! Here is the site in question: http://174.132.169.61/~wsiebiz/

    Thanks,
    Daniel

    • This topic was modified 1 year, 8 months ago by  halestorm.
    • This topic was modified 1 year, 8 months ago by  halestorm.
    #372

    Jon Weiss
    Moderator
    Post count: 14

    Looks to me like you want to pop that outside the content area, rather than have it display within the content div. There are several ways to do it, all of which are fine for your purposes. Let me know if you need further help and I’ll try to put some code together for you when I have a minute.


    #378

    halestorm
    Participant
    Post count: 3

    Yeah I tried what you are saying and I put the code of the widget (at least what I think is the widget out side of the what I think is just the area below the 3 middle widget but now the banner is on the top.  Just not 100% sure what I’m missing.  Here is what I did:

    <code>

    function agency_home_loop_helper() {

     

    if ( is_active_sidebar( ‘home-left’ ) || is_active_sidebar( ‘home-middle’ ) || is_active_sidebar( ‘home-right’ ) ) {

     

    echo ‘<div id=”home”>’;

     

    echo ‘<div class=”home-left”>’;

    dynamic_sidebar( ‘home-left’ );

    echo ‘</div><!– end .home-left –>’;

     

    echo ‘<div class=”home-middle”>’;

    dynamic_sidebar( ‘home-middle’ );

    echo ‘</div><!– end .home-middle –>’;

     

    echo ‘<div class=”home-right”>’;

    dynamic_sidebar( ‘home-right’ );

    echo ‘</div><!– end .home-right –>’;

     

    echo ‘</div><!– end #home –>’;

     

    }

    }

    if ( is_active_sidebar( ‘home-banner’ ) ) {

    echo ‘<div id=”home-banner”>’;

    dynamic_sidebar( ‘home-banner’ );

    echo ‘</div><!– end #home-banner –>’;

    }

     

    </code>

    http://174.132.169.61/~wsiebiz/

    • This reply was modified 1 year, 8 months ago by  halestorm.
    • This reply was modified 1 year, 8 months ago by  halestorm.
    • This reply was modified 1 year, 8 months ago by  halestorm.
    • This reply was modified 1 year, 8 months ago by  halestorm.
    • This reply was modified 1 year, 8 months ago by  halestorm.
    • This reply was modified 1 year, 8 months ago by  halestorm.
    #382

    halestorm
    Participant
    Post count: 3

    Here is the code for the whole home.php if that helps.

    <?php

    add_action( 'genesis_meta', 'agency_home_genesis_meta' );

    /**

    * Add widget support for homepage. If no widgets active, display the default loop.

    *

    */

    function agency_home_genesis_meta() {

    if ( is_active_sidebar( 'home-welcome' ) || is_active_sidebar( 'home-slider' ) || is_active_sidebar( 'home-left' ) || is_active_sidebar( 'home-middle' ) || is_active_sidebar( 'home-right' ) ) {

    remove_action( 'genesis_loop', 'genesis_do_loop' );

    add_action( 'genesis_after_header', 'agency_home_welcome_helper' );

    add_action( 'genesis_loop', 'agency_home_loop_helper' );

    add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );

    add_filter( 'body_class', 'add_body_class' );

    function add_body_class( $classes ) {

    $classes[] = 'agency';

    return $classes;

    }

    }

    }

    function agency_home_welcome_helper() {

    if ( is_active_sidebar( 'home-welcome' ) ) {

    echo '';

    dynamic_sidebar( 'home-welcome' );

    echo '';

    }

    if ( is_active_sidebar( 'home-slider' ) ) {

    echo '';

    dynamic_sidebar( 'home-slider' );

    echo '';

    }

    }

    function agency_home_loop_helper() {

    if ( is_active_sidebar( 'home-left' ) || is_active_sidebar( 'home-middle' ) || is_active_sidebar( 'home-right' ) ) {

    echo '';

    echo '';

    dynamic_sidebar( 'home-left' );

    echo '';

    echo '';

    dynamic_sidebar( 'home-middle' );

    echo '';

    echo '';

    dynamic_sidebar( 'home-right' );

    echo '';

    echo '';

    }

    }

    if ( is_active_sidebar( 'home-banner' ) ) {

    echo '';

    dynamic_sidebar( 'home-banner' );

    echo '';

    }

    genesis();

    #2080

    halestorm
    Participant
    Post count: 3

    I think this got buried…  So I’m refreshing it…

    #2367

    I have the same issue.  What is the solution?

    #2455

    Never mind……issue fixed.

    #12562

    ChicGeek
    Moderator
    Post count: 3

    Hi,

    Trying to do the same as described above. I need to duplicate the home-right, middle and left and the bubble. Was able to add the extra widgets, but they appeared below and not in their own bubble.

    Can someone post the solution. Any help appreciated!

    Thanks,

    Elisha


    The Pixel Spot A Recommended STUDIOPRESS CustomizerI Tweet

    Genesis Junkie + Web & Graphic Designer + Ad World Girl + Student of Life

    #30334

    matryx
    Participant
    Post count: 8

    Hi Everyone

    I am trying to add a new full size widget area under the three content boxes. I can register the widget with out any problems in the function.php but I really do not know where to add the code on the Home.php

    The code for the functions file…

    genesis_register_sidebar( array(
    ‘id’            => ‘home-optin’,
    ‘name’            => __( ‘Home Three’, ‘agency’ ),
    ‘description’    => __( ‘This is the optin section of the homepage.’, ‘agency’ ),
    ) );

    The new widget needs to be the same width as the slider but under the content boxes and above the footer widgets you can see the site here – http://www.buzinga.com.au/

    Do I need to add the || is_active_sidebar( ‘home-optin’ ) to this line

    function agency_home_genesis_meta() {

    if ( is_active_sidebar( ‘home-welcome’ ) || is_active_sidebar( ‘home-slider’ ) || is_active_sidebar( ‘home-left’ ) || is_active_sidebar( ‘home-middle’ ) || is_active_sidebar( ‘home-right’ ) ) {

    and also this line

    function agency_home_loop_helper() {

    if ( is_active_sidebar( ‘home-left’ ) || is_active_sidebar( ‘home-middle’ ) || is_active_sidebar( ‘home-right’ ) ) {

    I have tried doing this but I end up with the widget at the top of the page any help would be appreciated.

    Ron


    Full Time Online Marketer and website creation using WordPress

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

You must be logged in to reply to this topic.