Community Forums › Forums › Archived Forums › General Discussion › Showcase Pro Blog Template?
Tagged: blog page
- This topic has 6 replies, 3 voices, and was last updated 4 years, 7 months ago by
ChristineLeiser.
-
AuthorPosts
-
August 2, 2018 at 1:28 pm #222180
ChristineLeiser
ParticipantAs 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.comAugust 2, 2018 at 1:38 pm #222181Brad Dalton
ParticipantCreate a file named page_blog.php with a template header like this
August 5, 2018 at 11:37 am #222245ChristineLeiser
Participantthank 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 #222248Victor Font
ModeratorYour 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 #222249ChristineLeiser
ParticipantThank you Victor!
Does it matter where in the file I put that?
Just "Template Name: Blog" ?August 5, 2018 at 3:44 pm #222256Victor Font
ModeratorIt 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 #222259ChristineLeiser
ParticipantPerfect! Thank you so much! I was definitely over complicating things (I do that all the time.) again, thank you.
-
AuthorPosts
- The topic ‘Showcase Pro Blog Template?’ is closed to new replies.