• 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

Sub-container div class under site-container in Genesis

Last Updated on February 19, 2019 Favorited: 0 times

This tutorial provides the steps to add a sub-container HTML div class element under site-container in any theme based on the Genesis Framework.

Tested on Genesis Sample 2.6.0

The Idea:

The idea is pretty simple. I just opened the Genesis Hooks guide, Genesis Hook reference and find the location of `site-container` element.

Take the help from Genesis Visual hook and find the opening and closing location. Here, we have genesis_before_header ad genesis_after_footer. We will output a line of HTML for the opening and closing of this div.

STEP 1

Add the following snippet in child-theme/functions.php

add_action('genesis_before_header', 'designody_open_sub_container', 1);
/**
 * open sub-container
 */
function designody_open_sub_container() {
    echo '<div class="sub-container">';
}

add_action('genesis_after_footer', 'designody_close_sub_container', 20);
/**
 * close sub-container
 */
function designody_close_sub_container() {
    echo '</div>';
}

You can change the priority from 1 to high depending on the additional HTML.

STEP 2

Add the following CSS in child-theme/style.css

.sub-container {
    overflow: hidden;
}

Categories: Free Content, Genesis Tutorials Tags: html element

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