• 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

Copying Widget Areas from Altitude Pro

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 › Copying Widget Areas from Altitude Pro

This topic is: resolved

Tagged: php

  • This topic has 1 reply, 2 voices, and was last updated 9 years, 4 months ago by Victor Font.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • March 4, 2017 at 2:42 am #202438
    seancwalsh
    Member

    Hi there,

    I am currently in the process of learning how to build child themes from scratch. I have learnt how to add new widget areas and successfully implemented that into a theme, now I am trying to take functionality from other Studiopress themes, but this is where I am having trouble.

    I'm trying to copy the front page widget areas from the Altitude Pro theme and integrate them into my child theme.

    I have successfully registered the widget areas, as they are showing up the WP backend, but when I add some test content to the widgets, nothing shows up on the home page.

    Here is the code I have added to functions.php to register the widget areas, which I think there is no problem with:

    //* Register widget areas
    genesis_register_sidebar( array(
    	'id'          => 'front-page-1',
    	'name'        => __( 'Front Page 1', 'genesis-sample' ),
    	'description' => __( 'This is the front page 1 section.', 'genesis-sample' ),
    ) );
    genesis_register_sidebar( array(
    	'id'          => 'front-page-2',
    	'name'        => __( 'Front Page 2', 'genesis-sample' ),
    	'description' => __( 'This is the front page 2 section.', 'genesis-sample' ),
    ) );
    genesis_register_sidebar( array(
    	'id'          => 'front-page-3',
    	'name'        => __( 'Front Page 3', 'genesis-sample' ),
    	'description' => __( 'This is the front page 3 section.', 'genesis-sample' ),
    ) );
    genesis_register_sidebar( array(
    	'id'          => 'front-page-4',
    	'name'        => __( 'Front Page 4', 'genesis-sample' ),
    	'description' => __( 'This is the front page 4 section.', 'genesis-sample' ),
    ) );
    genesis_register_sidebar( array(
    	'id'          => 'front-page-5',
    	'name'        => __( 'Front Page 5', 'genesis-sample' ),
    	'description' => __( 'This is the front page 5 section.', 'genesis-sample' ),
    ) );
    genesis_register_sidebar( array(
    	'id'          => 'front-page-6',
    	'name'        => __( 'Front Page 6', 'genesis-sample' ),
    	'description' => __( 'This is the front page 6 section.', 'genesis-sample' ),
    ) );
    genesis_register_sidebar( array(
    	'id'          => 'front-page-7',
    	'name'        => __( 'Front Page 7', 'genesis-sample' ),
    	'description' => __( 'This is the front page 7 section.', 'genesis-sample' ),
    ) );
    

    Here is the code that is currently in front-page.php
    I have copied all of the code from the altitude-pro theme with a couple of minor edits

    
    add_action( 'genesis_meta', 'altitude_front_page_genesis_meta' );
    /**
     * Add widget support for homepage. If no widgets active, display the default loop.
     *
     */
    function altitude_front_page_genesis_meta() {
    
    	if ( is_active_sidebar( 'front-page-1' ) || is_active_sidebar( 'front-page-2' ) || is_active_sidebar( 'front-page-3' ) || is_active_sidebar( 'front-page-4' ) || is_active_sidebar( 'front-page-5' ) || is_active_sidebar( 'front-page-6' ) || is_active_sidebar( 'front-page-7' ) ) {
    
    		//* Enqueue scripts
    		add_action( 'wp_enqueue_scripts', 'altitude_enqueue_altitude_script' );
    		function altitude_enqueue_altitude_script() {
    
    			wp_enqueue_script( 'altitude-script', get_bloginfo( 'stylesheet_directory' ) . '/js/home.js', array( 'jquery' ), '1.0.0' );
    			wp_enqueue_script( 'localScroll', get_stylesheet_directory_uri() . '/js/jquery.localScroll.min.js', array( 'scrollTo' ), '1.2.8b', true );
    			wp_enqueue_script( 'scrollTo', get_stylesheet_directory_uri() . '/js/jquery.scrollTo.min.js', array( 'jquery' ), '1.4.5-beta', true );
    
    		}
    
    		//* Add front-page body class
    		add_filter( 'body_class', 'altitude_body_class' );
    		function altitude_body_class( $classes ) {
    
       			$classes[] = 'front-page';
    
      			return $classes;
    
    		}
    
    		//* Force full width content layout
    		add_filter( 'genesis_site_layout', '__genesis_return_full_width_content' );
    
    		//* Remove breadcrumbs
    		remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
    
    		//* Remove the default Genesis loop
    		remove_action( 'genesis_loop', 'genesis_do_loop' );
    
    		//* Add homepage widgets
    		add_action( 'genesis_loop', 'altitude_front_page_widgets' );
    
    		//* Add featured-section body class
    		if ( is_active_sidebar( 'front-page-1' ) ) {
    
    			//* Add image-section-start body class
    			add_filter( 'body_class', 'altitude_featured_body_class' );
    			function altitude_featured_body_class( $classes ) {
    
    				$classes[] = 'featured-section';
    				
    				return $classes;
    
    			}
    
    		}
    
    	}
    
    }
    
    //* Add markup for front page widgets
    function altitude_front_page_widgets() {
    
    	genesis_widget_area( 'front-page-1', array(
    		'before' => '<div id="front-page-1" class="front-page-1"><div class="image-section"><div class="flexible-widgets widget-area' . altitude_widget_area_class( 'front-page-1' ) . '"><div class="wrap">',
    		'after'  => '</div></div></div></div>',
    	) );
    
    	genesis_widget_area( 'front-page-2', array(
    		'before' => '<div id="front-page-2" class="front-page-2"><div class="solid-section"><div class="flexible-widgets widget-area' . altitude_widget_area_class( 'front-page-2' ) . '"><div class="wrap">',
    		'after'  => '</div></div></div></div>',
    	) );
    
    	genesis_widget_area( 'front-page-3', array(
    		'before' => '<div id="front-page-3" class="front-page-3"><div class="image-section"><div class="flexible-widgets widget-area' . altitude_widget_area_class( 'front-page-3' ) . '"><div class="wrap">',
    		'after'  => '</div></div></div></div>',
    	) );
    
    	genesis_widget_area( 'front-page-4', array(
    		'before' => '<div id="front-page-4" class="front-page-4"><div class="solid-section"><div class="flexible-widgets widget-area' . altitude_widget_area_class( 'front-page-4' ) . '"><div class="wrap">',
    		'after'  => '</div></div></div></div>',
    	) );
    
    	genesis_widget_area( 'front-page-5', array(
    		'before' => '<div id="front-page-5" class="front-page-5"><div class="image-section"><div class="flexible-widgets widget-area' . altitude_widget_area_class( 'front-page-5' ) . '"><div class="wrap">',
    		'after'  => '</div></div></div></div>',
    	) );
    
    	genesis_widget_area( 'front-page-6', array(
    		'before' => '<div id="front-page-6" class="front-page-6"><div class="solid-section"><div class="flexible-widgets widget-area' . altitude_widget_area_class( 'front-page-6' ) . '"><div class="wrap">',
    		'after'  => '</div></div></div></div>',
    	) );
    
    	genesis_widget_area( 'front-page-7', array(
    		'before' => '<div id="front-page-7" class="front-page-7"><div class="image-section"><div class="flexible-widgets widget-area' . altitude_widget_area_class( 'front-page-7' ) . '"><div class="wrap">',
    		'after'  => '</div></div></div></div>',
    	) );
    
    }
    
    
    genesis();
    

    Thanks in advance for any help,
    Sean

    March 4, 2017 at 8:43 am #202452
    Victor Font
    Moderator

    I guess you figured it since you didn't ask any questions and marked it resolved.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘General Discussion’ 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

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