• 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

Agentpress – widgets not connecting with home page

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 › Agentpress – widgets not connecting with home page

This topic is: resolved

Tagged: Agentpress

  • This topic has 3 replies, 2 voices, and was last updated 10 years, 8 months ago by AnitaC.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • September 3, 2014 at 10:14 pm #122708
    khcreativemedia
    Member

    I posted earlier about a site I'm developing with agentpress. Figured I would toss this problem out there to see if anyone has any ideas.

    Widgets on the home page have been working great. Apparently I did something to the front-page.php file and have now caused any updates on the widgets to not take effect on the home page. The widgets still have the content in them that I put in before I broke it, but now I can't make changes to the widgets and it change on the home page. All other pages are fine, which is how I know its something I did on the front-page file. I'm sure it's a simple bracket or something out of place. Anyone happen to have any ideas?

    Thanks,
    Keith

    <?php
    /**
     * This file adds the Home Page to the AgentPress Pro Theme.
     *
     * @author StudioPress
     * @package AgentPress Pro
     * @subpackage Customizations
     */
    
    //* Enqueue scripts
    add_action( 'wp_enqueue_scripts', 'agentpress_front_page_enqueue_scripts' );
    function agentpress_front_page_enqueue_scripts() {
    	
    	//* Load scripts only if custom background is being used
    	if ( ! get_option( 'agentpress-home-image' ) )
    		return;
    
    	//* Enqueue Backstretch scripts
    	wp_enqueue_script( 'agentpress-backstretch', get_bloginfo( 'stylesheet_directory' ) . '/js/backstretch.js', array( 'jquery' ), '1.0.0' );
    	wp_enqueue_script( 'agentpress-backstretch-set', get_bloginfo( 'stylesheet_directory' ).'/js/backstretch-set.js' , array( 'jquery', 'agentpress-backstretch' ), '1.0.0' );
    
    	wp_localize_script( 'agentpress-backstretch-set', 'BackStretchImg', array( 'src' => str_replace( 'http:', '', get_option( 'agentpress-home-image' ) ) ) );
    	
    	//* Add agentpress-pro-home body class
    	add_filter( 'body_class', 'agentpress_body_class' );
    
    }
    
    add_action( 'genesis_meta', 'agentpress_home_genesis_meta' );
    /**
     * Add widget support for homepage. If no widgets active, display the default loop.
     *
     */
    function agentpress_home_genesis_meta() {
    
    	if ( is_active_sidebar( 'home-featured' ) || is_active_sidebar( 'home-top' ) || is_active_sidebar( 'home-middle-1' ) || is_active_sidebar( 'home-middle-2' ) || is_active_sidebar( 'home-middle-3' ) || is_active_sidebar( 'home-bottom' ) ) {
    
    		//* Force full-width-content layout setting
    		add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
    		
    		//* Remove breadcrumbs
    		remove_action( 'genesis_before_content_sidebar_wrap', 'genesis_do_breadcrumbs' );
    
    		//* Remove the default Genesis loop
    		remove_action( 'genesis_loop', 'genesis_do_loop' );
    		
    		//* Add home featured area
    		add_action( 'genesis_after_header', 'agentpress_home_featured_widget' );
    		
    		//* Add home widget area
    		add_action( 'genesis_before_footer', 'agentpress_home_widgets', 1 );
    
    	}
    }
    
    function agentpress_body_class( $classes ) {
    
    		$classes[] = 'agentpress-pro-home';
    		return $classes;
    		
    }
    
    function agentpress_home_featured_widget() {
    
    	genesis_widget_area( 'home-featured', array(
    		'before' => '<div class="home-featured full-width widget-area"><div class="wrap">',
    		'after' => '</div></div>',
    	) );
    
    }
    
    function agentpress_home_widgets() {
    
    	genesis_widget_area( 'home-top', array(
    		'before' => '<div class="home-top full-width widget-area"><div class="wrap">',
    		'after'  => '</div></div>',
    	) );
    
    	if ( is_active_sidebar( 'home-middle-1' ) || is_active_sidebar( 'home-middle-2' ) || is_active_sidebar( 'home-middle-3' ) || is_active_sidebar( 'home-middle-4' ) ) {
    		
    		echo '<div class="home-middle"><div class="wrap">';
    		
    			genesis_widget_area( 'home-middle-1', array(
    				'before' => '<div class="home-middle-1 full-width widget-area">',
    				'after'  => '</div>',
    			) );
    
    		echo '</div></div>';
    		
    
    		echo '<div class="home-middle-below"><div class="wrap">';
    					
    			genesis_widget_area( 'home-middle-2', array(
    				'before' => '<div class="home-middle-2 widget-area">',
    				'after'  => '</div>',
    			) );
    			
    			genesis_widget_area( 'home-middle-3', array(
    				'before' => '<div class="home-middle-3 widget-area">',
    				'after'  => '</div>',
    			) );
    			
    			genesis_widget_area( 'home-middle-4', array(
    				'before' => '<div class="home-middle-4 widget-area">',
    				'after'  => '</div>',
    			) );
    			
    		echo '</div></div>';
    		
    	}
    	
    }
    
    genesis();
    http://rese.khcreativemedia.com/
    September 3, 2014 at 10:55 pm #122712
    AnitaC
    Keymaster

    Use FTP and copy the original file over to the server. Or open it on your desktop and copy/paste it over. That should fix it.


    Need help with customization or troubleshooting? Reach out to me.

    September 3, 2014 at 11:01 pm #122713
    khcreativemedia
    Member

    Sometimes it's the simplest answers. This took care of it. Originally I didn't want to do this because I didn't want to overwrite my file. Looks like I hadn't made any real changes in there after all.

    Thanks,
    Keith

    September 3, 2014 at 11:11 pm #122714
    AnitaC
    Keymaster

    If it happens again, use the DiffChecker.com. You put the original file on the left and your edited version on the right. The Find the Difference. It will show you what the differences are. I used it daily.


    Need help with customization or troubleshooting? Reach out to me.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Agentpress – widgets not connecting with home page’ is closed to new 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