• 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

Showcase Pro Blog 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 › General Discussion › Showcase Pro Blog Template?

This topic is: resolved

Tagged: blog page

  • This topic has 6 replies, 3 voices, and was last updated 4 years, 7 months ago by ChristineLeiser.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • August 2, 2018 at 1:28 pm #222180
    ChristineLeiser
    Participant

    As another thread addressed, the Showcase Pro child theme does not include a blog template. Following the instructions on that other thread, causes the blog page to become the home page, that's not what I'm looking to do. I want the blog page to be another page with all blog posts showing, accessible from the menu on the home page. Can anyone point me in the direction of making a blog page template for use in that manner?

    Thank you.

    http://newporthay.com
    August 2, 2018 at 1:38 pm #222181
    Brad Dalton
    Participant

    Create a file named page_blog.php with a template header like this


    Tutorials for StudioPress Themes.

    August 5, 2018 at 11:37 am #222245
    ChristineLeiser
    Participant

    thank you, Brad. There is already a page_blog.php - It's content is as follows:

    <?php
    /**
    * Showcase Pro
    *
    * This file edits the blog page page template in the Showcase Pro Theme.
    *
    * @package Showcase
    * @author Bloom
    * @license GPL-2.0+
    * @link http://my.studiopress.com/themes/showcase/
    */

    // Add the with-page-header class
    add_filter( 'body_class', 'showcase_blog_page_header_body_class' );
    function showcase_blog_page_header_body_class( $classes ) {

    $posts_page_id = get_option('page_for_posts');

    if( has_post_thumbnail($posts_page_id) )
    $classes[] = 'with-page-header';

    return $classes;

    }

    // Add the Blog Page Header
    remove_action( 'genesis_after_header', 'showcase_page_header', 8 );
    add_action( 'genesis_after_header', 'showcase_blog_page_header', 8 );
    function showcase_blog_page_header() {
    $output = false;
    $posts_page_id = get_option('page_for_posts');
    $image = get_post_thumbnail_id( $posts_page_id );

    if( $image ) {

    // Remove the page title because we're going to add it later
    remove_action( 'genesis_before_loop', 'genesis_do_posts_page_heading' );

    $image = wp_get_attachment_image_src( $image, 'showcase_hero' );
    $background_image_class = 'with-background-image';
    $title = get_the_title($posts_page_id);

    $output .= '<div class="page-header bg-primary with-background-image" style="background-image: url(' . $image[0] . ');"><div class="wrap">';
    $output .= '<div class="header-content"><h1>' . $title . '</h1></div>';
    $output .= '</div></div>';
    }

    if( $output )
    echo $output;
    }

    genesis();

    I'm not sure what's missing that keeps it from providing me with a blog page template.

    Any ideas?

    Thank you.

    August 5, 2018 at 12:04 pm #222248
    Victor Font
    Moderator

    Your page_blog.php is missing Template Name: Blog in the header.


    Regards,

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

    August 5, 2018 at 12:16 pm #222249
    ChristineLeiser
    Participant

    Thank you Victor!
    Does it matter where in the file I put that?
    Just "Template Name: Blog" ?

    August 5, 2018 at 3:44 pm #222256
    Victor Font
    Moderator

    It matters. You place it in the header comments prefaced with the asterisk.

    /**
    * Showcase Pro
    *
    * Template Name: Blog
    *
    * This file edits the blog page page template in the Showcase Pro Theme.
    *
    * @package Showcase
    * @author Bloom
    * @license GPL-2.0+
    * @link http://my.studiopress.com/themes/showcase/
    */

    Regards,

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

    August 5, 2018 at 5:36 pm #222259
    ChristineLeiser
    Participant

    Perfect! Thank you so much! I was definitely over complicating things (I do that all the time.) again, thank you.

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Showcase Pro Blog Template?’ 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

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