• 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

Creating a Home Page Template

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 › Creating a Home Page Template

This topic is: not resolved

Tagged: Page Templates, streamline pro

  • This topic has 4 replies, 3 voices, and was last updated 11 years, 8 months ago by BlueSunInc.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • June 13, 2014 at 7:12 pm #109651
    BlueSunInc
    Member

    My client wants to create a template that's a duplicate of the home page. So far he's gotten the template set up, but neither of us can get the blog post excerpts to show up like they do on the home page itself (his reason for making a dupe of the home page is for some split testing he wants to do).

    Can anyone figure out what's missing and tell me what to add? I'm feeling there's a function that needs adding/changing, I just can't see where or what it is. Thanks

    http://www.teamrcia.com/homepage2/
    June 14, 2014 at 6:29 am #109702
    AnitaC
    Keymaster

    Is the grid loop in your code. It's hard to help when we don't have say, what your functions.php file looks like. But are they the same thing?


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

    June 14, 2014 at 10:22 am #109734
    BlueSunInc
    Member

    Here's the functions.php file:

    <?php
    
    //* Start the engine
    
    include_once( get_template_directory() . '/lib/init.php' );
    
    //* Set Localization (do not remove)
    
    load_child_theme_textdomain( 'streamline', apply_filters( 'child_theme_textdomain', get_stylesheet_directory() . '/languages', 'streamline' ) );
    
    //* Child theme (do not remove)
    
    define( 'CHILD_THEME_NAME', __( 'Streamline Pro Theme', 'streamline' ) );
    
    define( 'CHILD_THEME_URL', 'http://my.studiopress.com/streamline/' );
    
    define( 'CHILD_THEME_VERSION', '2.0.0' );
    
    //* Add HTML5 markup structure
    
    add_theme_support( 'html5' );
    
    //* Add viewport meta tag for mobile browsers
    
    add_theme_support( 'genesis-responsive-viewport' );
    
    //* Enqueue PT Sans Google font
    
    add_action( 'wp_enqueue_scripts', 'streamline_google_fonts' );
    
    function streamline_google_fonts() {
    
    	wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=PT+Sans', array(), CHILD_THEME_VERSION );
    
    	
    
    }
    
    //* Enqueue Responsive Menu Script
    
    add_action( 'wp_enqueue_scripts', 'streamline_enqueue_responsive_script' );
    
    function streamline_enqueue_responsive_script() {
    
    	wp_enqueue_script( 'streamline-responsive-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' );
    
    }
    
    //* Add support for additional color style options
    
    add_theme_support( 'genesis-style-selector', array( 
    
    	'streamline-pro-blue'  => __( 'Streamline Pro Blue', 'streamline' ), 
    
    	'streamline-pro-green' => __( 'Streamline Pro Green', 'streamline' ),
    
    ) );
    
    //* Add new image sizes
    
    add_image_size( 'post-image', 760, 360, TRUE );
    
    add_image_size( 'widget-image', 295, 100, TRUE );
    
    //* Unregister layout settings
    
    genesis_unregister_layout( 'content-sidebar-sidebar' );
    
    genesis_unregister_layout( 'sidebar-content-sidebar' );
    
    genesis_unregister_layout( 'sidebar-sidebar-content' );
    
    //* Unregister secondary sidebar
    
    unregister_sidebar( 'sidebar-alt' );
    
    //* Add support for custom background
    
    add_theme_support( 'custom-background' );
    
    //* Add support for custom header
    
    add_theme_support( 'custom-header', array(
    
    	'header_image'    => '',
    
    	'header-selector' => '.site-title a',
    
    	'header-text'     => false,
    	
    	'flex-width'    => true,
    	'width'         => 550,
    	'flex-height'    => true,
    	'height'        => 180,
    
    ) );
    
    //* Add support for 3-column footer widgets
    
    add_theme_support( 'genesis-footer-widgets', 3 );
    
    //* Reposition the breadcrumbs
    
    remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
    
    add_action( 'genesis_before_content_sidebar_wrap', 'genesis_do_breadcrumbs' );
    
    //* Customize breadcrumbs display
    
    add_filter( 'genesis_breadcrumb_args', 'streamline_breadcrumb_args' );
    
    function streamline_breadcrumb_args( $args ) {
    
    	$args['home'] = __( 'Home', 'streamline' );
    
    	$args['sep'] = ' ';
    
    	$args['list_sep'] = ', '; // Genesis 1.5 and later
    
    	$args['prefix'] = '<div class="breadcrumb">';
    
    	$args['suffix'] = '</div>';
    
    	$args['labels']['prefix'] = '<span class="icon-home">';
    
    	$args['labels']['suffix'] = '</div>';
    
    	return $args;
    
    }
    
    //* Remove default post image
    
    remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
    
    //* Add post image above post title
    
    add_action( 'genesis_entry_header', 'streamline_post_image', 1 );
    
    function streamline_post_image() {
    
    	if ( is_page() || ! genesis_get_option( 'content_archive_thumbnail' ) )
    
    		return;
    
    	
    
    	if ( $image = genesis_get_image( array( 'format' => 'url', 'size' => genesis_get_option( 'image_size' ) ) ) ) {
    
    		printf( '<a href="%s" rel="bookmark"><img class="post-photo" src="%s" alt="%s" /></a>', get_permalink(), $image, the_title_attribute( 'echo=0' ) );
    
    	}
    
    	
    
    }
    
    //* Reposition the post info function
    
    remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
    
    add_action( 'genesis_entry_header', 'genesis_post_info', 2 );
    
    //* Customize the post info function
    
    add_filter( 'genesis_post_info', 'post_info_filter' );
    
    function post_info_filter( $post_info ) {
    
    	if ( !is_page() ) {
    
        	$post_info = '[post_author_posts_link] [post_date] [post_comments] [post_edit]';
    
        	return $post_info;
    
    	}
    
    	
    
    }
    
    //* Add the after entry section
    
    add_action( 'genesis_entry_footer', 'streamline_after_entry', 10 );
    
    function streamline_after_entry() {
    
    	
    
    	if ( ! is_singular( 'post' ) ) return;
    
    	
    
    	genesis_widget_area( 'after-entry', array(
    
    		'before' => '<div class="after-entry widget-area">',
    
    		'after'  => '</div>',
    
       ) );
    
       
    
    }
    
    //* Modify the size of the Gravatar in the author box
    
    add_filter( 'genesis_author_box_gravatar_size', 'streamline_author_box_gravatar_size' );
    
    function streamline_author_box_gravatar_size( $size ) {
    
        return '80';
    
        
    
    }
    
    //* Remove comment form allowed tags
    
    add_filter( 'comment_form_defaults', 'streamline_remove_comment_form_allowed_tags' );
    
    function streamline_remove_comment_form_allowed_tags( $defaults ) {
    
    	$defaults['comment_notes_after'] = '';
    
    	return $defaults;
    
    	
    
    }
    
    // Register widget areas
    
    genesis_register_sidebar( array(
    
    	'id'          => 'home-featured-1',
    
    	'name'        => __( 'Home - Featured 1', 'streamline' ),
    
    	'description' => __( 'This is the first featured column on the homepage.', 'streamline' ),
    
    ) );
    
    genesis_register_sidebar( array(
    
    	'id'          => 'home-featured-2',
    
    	'name'        => __( 'Home - Featured 2', 'streamline' ),
    
    	'description' => __( 'This is the second featured column on the homepage.', 'streamline' ),
    
    ) );
    
    genesis_register_sidebar( array(
    
    	'id'          => 'home-featured-3',
    
    	'name'        => __( 'Home - Featured 3', 'streamline' ),
    
    	'description' => __( 'This is the third featured column on the homepage.', 'streamline' ),
    
    ) );
    
    genesis_register_sidebar( array(
    
    	'id'          => 'after-entry',
    
    	'name'        => __( 'After Entry', 'streamline' ),
    
    	'description' => __( 'This is the after entry section.', 'streamline' ),
    
    ) );
    
    //* Display a custom favicon
    add_filter( 'genesis_pre_load_favicon', 'sp_favicon_filter' );
    function sp_favicon_filter( $favicon_url ) {
    	return 'http://www.teamrcia.com/favicon.ico';
    }
    June 14, 2014 at 11:30 am #109741
    Lorraine
    Participant

    You should be looking at the template file the client created. This would be a copy of home.php.

    This is what calls the loop, you could try adding manually. I haven't tested this and can't say for sure but that is where I would start playing...

    add_action('genesis_loop', 'genesis_do_loop');

    Or yesterday I created a template using

    <div class="entry-content">
        <?php the_content(); ?>
     </div>'; 

    http://codex.wordpress.org/The_Loop This should answer a few questions, as will http://codex.wordpress.org/Page_Templates

    June 14, 2014 at 11:49 am #109744
    BlueSunInc
    Member

    That makes sense, Lorraine. Here's the template code. Where would I insert the loop then?

    <?php
    
    /*
     * Template Name: Home Page 2
     */
    /**
     * This file adds the Home Page to the Streamline Pro Theme.
     *
     * @author StudioPress
     * @package Streamline Pro
     * @subpackage Customizations
     */
    
    add_action( 'genesis_meta', 'streamline_home_genesis_meta' );
    /**
     * Add widget support for homepage. If no widgets active, display the default loop.
     *
     */
    function streamline_home_genesis_meta() {
    
    	if ( is_active_sidebar( 'home-featured-1' ) || is_active_sidebar( 'home-featured-2' ) || is_active_sidebar( 'home-featured-3' ) ) {
    	
    		//* Force content-sidebar layout setting
    		add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' );
    	
    		// Add streamline-pro-home body class
    		add_filter( 'body_class', 'streamline_body_class' );
    	
    		// Add homepage widgets
    		add_action( 'genesis_before_content_sidebar_wrap', 'streamline_homepage_widgets' );
    
    	}
    }
    
    function streamline_body_class( $classes ) {
    
    	$classes[] = 'streamline-pro-home';
    	return $classes;
    	
    }
    
    function streamline_homepage_widgets() {
    
    	if ( is_active_sidebar( 'home-featured-1' ) || is_active_sidebar( 'home-featured-2' ) || is_active_sidebar( 'home-featured-3' ) ) {
    
    		echo '<div class="home-featured">';
    	
    		genesis_widget_area( 'home-featured-1', array(
    			'before' => '<div class="home-featured-1 widget-area">',
    			'after'  => '</div>',
    		) );
    		
    		genesis_widget_area( 'home-featured-2', array(
    			'before' => '<div class="home-featured-2 widget-area">',
    			'after'  => '</div>',
    		) );
    		
    		genesis_widget_area( 'home-featured-3', array(
    			'before' => '<div class="home-featured-3 widget-area">',
    			'after'  => '</div>',
    		) );
    
    		echo '</div><!-- end #home-featured -->';	
    
    	}
    
    }
    
    genesis();
    
  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 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