• 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

add home-slider and home-welcome to all pages in agency

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 › add home-slider and home-welcome to all pages in agency

This topic is: not resolved
  • This topic has 1 reply, 2 voices, and was last updated 13 years, 3 months ago by Brad Dalton.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • July 23, 2013 at 1:12 pm #52120
    KarenLeighBurton
    Member

    I have a client who wants the home-welcome area and the home-slider to appear on all pages/posts within the agency theme. I am not strong with php and calls/hooks, so I need someone to dumb it down. What needs to be included in the page/post template and what needs to go in the functions to make this happen?

    I thought adding this to a page.php file would do the trick...

    <?php
    /*
     WARNING: This file is part of the core Genesis framework. DO NOT edit
     this file under any circumstances. Please do all modifications
     in the form of a child theme.
     */
    
    /**
     * This file handles pages, but only exists for the sake of
     * child theme forward compatibility.
     *
     * This file is a core Genesis file and should not be edited.
     *
     * @category Genesis
     * @package  Templates
     * @author   StudioPress
     * @license  http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later)
     * @link     http://www.studiopress.com/themes/genesis
     */
    
    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 '<div id="home-welcome">';
    		dynamic_sidebar( 'home-welcome' );
    		echo '</div><!-- end #home-welcome -->';
    	}
    
    	if ( is_active_sidebar( 'home-slider' ) ) {
    		echo '<div id="home-slider">';
    		dynamic_sidebar( 'home-slider' );
    		echo '</div><!-- end #home-slider -->';
    	}
    
    }
    
    genesis();
    
    http://www.tanyamalcolm.com
    July 23, 2013 at 1:53 pm #52124
    Brad Dalton
    Participant

    The reason they only display on home is because they are in the home.php file.

    You will need to take the code and use it in a custom function in your child themes functions.php file

    You will also need to use a conditional tag so it displays site wide, but not on your home page.

    Use the same classes as generated in your home.php file.

    Another option is to remove the code which generates these 2 widgets from your home.php file and add it to your functions.php file using the same classes so you don't need to add CSS. You can then add hooks to the code and won't need a conditional tag as its site wide.

    I've done this before many times and written several posts on how to do it different ways.


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 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

© 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