• 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

Front Page Widget Issue

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 › Design Tips and Tricks › Front Page Widget Issue

This topic is: resolved

Tagged: front page, home page, widgets

  • This topic has 2 replies, 2 voices, and was last updated 10 years, 6 months ago by theKatrinaM.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • December 16, 2014 at 6:25 pm #134717
    theKatrinaM
    Member

    My widgets for my home page are appearing above my header. I'm not sure why it's happening I've check the coding serval times.

    My PHP:

    <?php
    
    add_action( 'genesis_meta', 'riot_home_genesis_meta' );
    /**
     * Add widget support for front page. If no widgets active, display the default loop.
     *
     */
    function riot_home_genesis_meta() {
    
    	if ( is_active_sidebar( 'home-top-left' ) || is_active_sidebar( 'home-top-right' )|| is_active_sidebar( 'home-middle-left' ) || is_active_sidebar( 'home-middle-middle' ) || is_active_sidebar( 'home-middle-right' )) {
    
    		//* Force full-width-content layout setting
    		add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
    
    		// Add riot-home body class
    		add_filter( 'body_class', 'riot_body_class' );
    		function riot_body_class( $classes ) {
       			$classes[] = 'riot-home';
      			return $classes;
    		}
    
    		// Remove the default Genesis loop
    		remove_action( 'genesis_loop', 'genesis_do_loop' );
    
    		// Add homepage widgets
    		add_action( 'genesis_loop', 'riot_homepage_widgets' );
    
    	}
    
    function riot_homepage_widgets() {
    
    		genesis_widget_area( 'home-top', array(
    		'before' => '<div class="home-top widget-area">',
    	) );
    
     if ( is_active_sidebar( 'home-top-left' ) || is_active_sidebar( 'home-top-right' ) ) {
    
    		echo '<div class="home-top">';
    
    		genesis_widget_area( 'home-top-left', array(
    			'before' => '<div class="home-top-left widget-area">',
    		) );
    
    		genesis_widget_area( 'home-top-right', array(
    			'before' => '<div class="home-top-right widget-area">',
    		) );
    
    		echo '</div>';
    	
    	}
    }
    		genesis_widget_area( 'home-middle', array(
    			'before' => '<div class="home-middle widget-area">',
    		) );
    
    if ( is_active_sidebar( 'home-middle-left' ) || is_active_sidebar( 'home-middle-middle' )|| is_active_sidebar( 'home-middle-right' ) ) {
    
    		echo '<div class="home-middle">';
    
    		genesis_widget_area( 'home-middle-left', array(
    			'before' => '<div class="home-left widget-area">',
    		) );
    
    		genesis_widget_area( 'home-middle-middle', array(
    			'before' => '<div class="home-middle widget-area">',
    		) );
    
    		genesis_widget_area( 'home-middle-right', array(
    			'before' => '<div class="home-right widget-area">',
    		) );
    
    		echo '</div>';
    	
    	}
    }
    
    genesis();

    My CSS:

    /* Home Page
    --------------------------------------------- */
    .home-top {
    	overflow: hidden;
    }
    
    .home-top-left {
    	float: left;
    	width: 785px;
    }
    
    .home-top-right {
    	background: #f3f3f3;
    	float: right;
    	height: 415px;
    	padding: 20px;
    	text-align: center;
    	width: 330px;
    	position: relative;
    	top: -420px;
    	left: 350px;
    }
    
    .home-top-right .widget-title:before {
    	color: #f21062;
    	content: "\f307";
    	display: block;
    	-webkit-font-smoothing: antialiased;
    	font: normal 30px/1 'dashicons';
    	padding-bottom: 20px;
    	vertical-align: top;
    }
    
    .home-middle {
    	clear: both;
    	margin: 30px 0;
    	overflow: hidden;
    }
    
    .home-middle-left,
    .home-middle-middle,
    .home-middle-right {
    	padding: 13px;
    	text-align: center;
    }
    .home-middle-left .widget-title:before {
    	color: #f21062;
    	content: "\f086";
    	display: block;
    	-webkit-font-smoothing: antialiased;
    	font: normal 30px/1 'fontawesome';
    	padding-bottom: 20px;
    	vertical-align: top;
    }
    
    .home-middle-middle .widget-title:before {
    	color: #f21062;
    	content: "\f19d";
    	display: block;
    	-webkit-font-smoothing: antialiased;
    	font: normal 30px/1 'fontawesome';
    	padding-bottom: 20px;
    	vertical-align: top;
    }
    
    .home-middle-right .widget-title:before {
    	color: #f21062;
    	content: "\f019";
    	display: block;
    	-webkit-font-smoothing: antialiased;
    	font: normal 30px/1 'fontawesome';
    	padding-bottom: 20px;
    	vertical-align: top;
    }

    “People are only supposed to believe the legends not understand them.” Norman Collins
    Design | Blog

    https://riotcustoms.com/
    December 18, 2014 at 2:10 pm #134836
    WisdmLabs
    Member

    Hi,
    Try changing the hook from 'genesis_meta' to 'get_header'

    Refer this article for creating widgetized homepage step by step


    http://wisdmlabs.com/

    December 18, 2014 at 2:26 pm #134840
    theKatrinaM
    Member

    Thanks @WisdmLabs I was able to get it to work keeping the 'genesis_meta'

    `<?php

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

    if ( is_active_sidebar('home-top-left' ) || is_active_sidebar('home-top-right') || is_active_sidebar( 'home-middle1' ) || is_active_sidebar( 'home-middle2' ) || is_active_sidebar( 'home-middle3' )|| 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 riot-home body class
    add_filter( 'body_class', 'riot_body_class' );
    function riot_body_class( $classes ) {
    $classes[] = 'riot-home';
    return $classes;
    }

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

    // Add homepage widgets
    add_action( 'genesis_loop', 'riot_homepage_widgets' );

    }
    }

    function riot_homepage_widgets() {

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

    echo '<div class="home-top">';

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

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

    echo '</div>';

    }

    if ( is_active_sidebar( 'home-middle1' ) || is_active_sidebar('home-middle2') || is_active_sidebar( 'home-middle3' )) {

    echo '<div class="home-middle">';

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

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

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

    echo '</div>';

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

    }
    }

    genesis();


    “People are only supposed to believe the legends not understand them.” Norman Collins
    Design | Blog

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 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