• 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

Metro Pro theme – footer widgets home page only

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 › Metro Pro theme – footer widgets home page only

This topic is: not resolved
  • This topic has 5 replies, 2 voices, and was last updated 12 years, 5 months ago by MissKitty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • May 20, 2014 at 8:13 am #106009
    MissKitty
    Participant

    Hi again -
    So I'm trying to display the footer widgets on the home page only.

    I've tried adding to the bottom of functions:

    add_action( 'genesis_before', 'metro_display_footer_front_page' );
    function metro_display_footer_front_page() {
    if( !is_front_page() ) {
    remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' );
    }}
    

    to no avail, and also tried:

    add_action( 'genesis_before', 'metro_display_footer_home' );
    /***
    * @author Brad Dalton - WP Sites
    * @learn more http://wpsites.net/web-design/remove-footer-specific-pages/
    ***/
    function wpsites_display_footer_home() {
    if( !is_home() ) {
    remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' );
    
      }
    
    }
    

    also to no avail. I also tried the second code replacing !is_home with !is_front_page...
    and nothing.

    Could someone PLEASE assist?

    This is my current functions file:

    <?php
    //* Start the engine
    include_once( get_template_directory() . '/lib/init.php' );
    
    //* Set Localization (do not remove)
    load_child_theme_textdomain( 'metro', apply_filters( 'child_theme_textdomain', get_stylesheet_directory() . '/languages', 'metro' ) );
    
    //* Child theme (do not remove)
    define( 'CHILD_THEME_NAME', __( 'Metro Pro Theme', 'metro' ) );
    define( 'CHILD_THEME_URL', 'http://my.studiopress.com/themes/metro/' );
    define( 'CHILD_THEME_VERSION', '2.0.1' );
    
    //* Add HTML5 markup structure
    add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list' ) );
    
    //* Add viewport meta tag for mobile browsers
    add_theme_support( 'genesis-responsive-viewport' );
    
    //* Enqueue Google fonts
    add_action( 'wp_enqueue_scripts', 'metro_google_fonts' );
    function metro_google_fonts() {
    	wp_enqueue_style( 'google-font', '//fonts.googleapis.com/css?family=Oswald:400', array(), CHILD_THEME_VERSION );
    }
    
    //* Enqueue Backstretch script and prepare images for loading
    add_action( 'wp_enqueue_scripts', 'metro_enqueue_scripts' );
    function metro_enqueue_scripts() {
    
    	//* Load scripts only if custom background is being used
    	if ( ! get_background_image() )
    		return;
    
    	wp_enqueue_script( 'metro-pro-backstretch', get_bloginfo( 'stylesheet_directory' ) . '/js/backstretch.js', array( 'jquery' ), '1.0.0' );
    	wp_enqueue_script( 'metro-pro-backstretch-set', get_bloginfo('stylesheet_directory').'/js/backstretch-set.js' , array( 'jquery', 'metro-pro-backstretch' ), '1.0.0' );
    
    	wp_localize_script( 'metro-pro-backstretch-set', 'BackStretchImg', array( 'src' => str_replace( 'http:', '', get_background_image() ) ) );
    
    }
    
    //* Add custom background callback for background color
    function metro_background_callback() {
    
    	if ( ! get_background_color() )
    		return;
    
    	printf( '<style>body { background-color: #%s; }</style>' . "\n", get_background_color() );
    
    }
    
    //* Add new image sizes
    add_image_size( 'home-bottom', 150, 150, TRUE );
    add_image_size( 'home-middle', 332, 190, TRUE );
    add_image_size( 'home-top', 700, 400, TRUE );
    
    //* Add support for custom background
    add_theme_support( 'custom-background', array( 'wp-head-callback' => 'metro_background_callback' ) );
    
    //* Add support for custom header -edited jlr former width 270 former ht 80
    add_theme_support( 'custom-header', array(
    	'width'           => 700,
    	'height'          => 122,
    	'header-selector' => '.site-title a',
    	'header-text'     => false
    ) );
    
    //* Add support for additional color style options
    add_theme_support( 'genesis-style-selector', array(
    	'metro-pro-blue'  => __( 'Blue', 'metro' ),
    	'metro-pro-green' => __( 'Green', 'metro' ),
    	'metro-pro-pink'  => __( 'Pink', 'metro' ),
    	'metro-pro-red'   => __( 'Red', 'metro' ),
    ) );
    
    //* Add support for 3-column footer widgets
    add_theme_support( 'genesis-footer-widgets', 3 );
    
    //* Reposition the secondary navigation
    remove_action( 'genesis_after_header', 'genesis_do_subnav' );
    add_action( 'genesis_before', 'genesis_do_subnav' );
    
    //* Hooks after-entry widget area to single posts
    add_action( 'genesis_entry_footer', 'metro_after_post'  ); 
    function metro_after_post() {
    
        if ( ! is_singular( 'post' ) )
        	return;
    
        genesis_widget_area( 'after-entry', array(
    		'before' => '<div class="after-entry widget-area"><div class="wrap">',
    		'after'  => '</div></div>',
        ) );
    
    }
    
    //* Remove comment form allowed tags
    add_filter( 'comment_form_defaults', 'metro_remove_comment_form_allowed_tags' );
    function metro_remove_comment_form_allowed_tags( $defaults ) {
    	
    	$defaults['comment_notes_after'] = '';
    	return $defaults;
    
    }
    
    //* Reposition the footer widgets
    remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' );
    add_action( 'genesis_after', 'genesis_footer_widget_areas' );
    
    //* Reposition the footer
    remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5 );
    remove_action( 'genesis_footer', 'genesis_do_footer' );
    remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15 );
    add_action( 'genesis_after', 'genesis_footer_markup_open', 11 );
    add_action( 'genesis_after', 'genesis_do_footer', 12 );
    add_action( 'genesis_after', 'genesis_footer_markup_close', 13 );
    
    //* Register widget areas
    genesis_register_sidebar( array(
    	'id'          => 'home-top',
    	'name'        => __( 'Home - Top', 'metro' ),
    	'description' => __( 'This is the top section of the homepage.', 'metro' ),
    ) );
    //genesis_register_sidebar( array(
    //	'id'          => 'home-middle-left',
    //	'name'        => __( 'Home - Middle Left', 'metro' ),
    //	'description' => __( 'This is the middle left section of the homepage.', 'metro' ),
    //) );
    //genesis_register_sidebar( array(
    //	'id'          => 'home-middle-right',
    //	'name'        => __( 'Home - Middle Right', 'metro' ),
    //	'description' => __( 'This is the middle right section of the homepage.', 'metro' ),
    //) );
    genesis_register_sidebar( array(
    	'id'          => 'home-bottom',
    	'name'        => __( 'Home - Bottom', 'metro' ),
    	'description' => __( 'This is the bottom section of the homepage.', 'metro' ),
    ) );
    genesis_register_sidebar( array(
    	'id'          => 'after-entry',
    	'name'        => __( 'After Entry', 'metro' ),
    	'description' => __( 'This is the after entry section.', 'metro' ),
    ) );
    
    //* Unregister sidebar/content layout setting
    genesis_unregister_layout( 'sidebar-content' );
    
    //* Unregister content/sidebar/sidebar layout setting
    genesis_unregister_layout( 'content-sidebar-sidebar' );
     
    //* Unregister sidebar/sidebar/content layout setting
    genesis_unregister_layout( 'sidebar-sidebar-content' );
    
    //* Unregister sidebar/content/sidebar layout setting
    genesis_unregister_layout( 'sidebar-content-sidebar' );
    
    //* unregister secondary sidebar
    unregister_sidebar( 'sidebar-alt' );
    

    Thank you in advance!

    May 20, 2014 at 11:04 am #106036
    Brad Dalton
    Participant

    Link to your site please.

    You've changed the name of my function so that code you republished above from my site is broken now.


    Tutorials for StudioPress Themes.

    May 20, 2014 at 12:20 pm #106053
    MissKitty
    Participant

    I'm sorry Brad! (btw, breaking code is my unintended specialty 🙂

    here's the link:
    home page...
    http://bit.ly/1vAFXrI
    interior...
    http://bit.ly/1jRWY77

    I did try your code from this page:

    Remove Footer Or Widgets On Specific Pages

    add_action( 'genesis_before', 'wpsites_display_footer_front_page' );
    function wpsites_display_footer_front_page() {
    if( !is_front_page() ) {
    remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' );
    }}
    

    to no avail. What the heck am I doing wrong?

    May 20, 2014 at 9:14 pm #106117
    Brad Dalton
    Participant

    You are right with that code. It doesn't work. Will need to work out why and update the code in the Gist which i will do shortly and post back when done. Thanks for alerting me to this code.


    Tutorials for StudioPress Themes.

    May 21, 2014 at 7:02 am #106155
    MissKitty
    Participant

    Thank you.

    May 24, 2014 at 7:40 am #106592
    MissKitty
    Participant

    Braddalton, any update on the code?
    Thanks in advance....

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