• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar
  • Skip to user navigation

PopWP

WordPress and Genesis Tutorials

  • Get Started
  • About
  • Archive
  • Services
  • Membership
  • My Account

Display Multiple Widgets area in Genesis

Last Updated on June 15, 2018 Favorited: 0 times

This is Step 2. Have you followed the Step 1. Register Multiple widgets areas in Genesis?

Let’s say we want to display 6 widget areas for the front page we have registered earlier. The code for this is something like this and will be added in front-page.php

//* Display front-page widget areas
genesis_widget_area( 'front-page-1', array(
    'before' => '<div class="front-page-1 widget-area"><div class="wrap">',
    'after'  => '</div></div>',
) );

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

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

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

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

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

or, simply use

//* Display front-page widget areas.
for ( $i = 1; $i <= 6; $i++ ) {
    genesis_widget_area( "front-page-{$i}", array(
        'before' => '<div class="front-page-' . $i . ' widget-area"><div class="wrap">',
        'after'  => '</div></div>',
    ) );
}

Source: https://sridharkatakam.com/simplifying-code-displaying-multiple-widget-areas-genesis/

Categories: Free Content, Genesis Tutorials

Reader Interactions

Primary Sidebar

Search

WPEngine WordPress Hosting, Perfected.

Hosting You are looking for?.
Perfect solution for small business to global enterprise.

Learn more

StudioPress Genesis Theme Framework

The No.1 Theme Provider.
Creative, SEO rich Theme for all niche projects.

Learn more

Categories

  • Free Content
  • Genesis Tutorials
  • Premium Content
  • Snippets
  • What's New?
  • WordPress Tutorials

Tag Cloud

Archive Background Section blog canvas menu center logo columns conditional tags CSS CSS Grid custom Customizer custom post type Custom Post Types custom template Custom Widget effect eNews Extended Featured Image front-page Genesis Genesis Sample header right hero section Image Background js layout left menu Logo menu Navigation Menu newsletter post page related posts responsive menu search search widget Shrinking Logo site header slide in-out Stylesheet Template Utility Bar Video Background widgets WordPress

Built with Genesis Framework + WordPress by Aryan Raj

  • Contact
  • FAQ
  • Disclaimer
  • Privacy Policy
  • Copyright Policy
  • Terms of Service