Community Forums › Forums › Archived Forums › Design Tips and Tricks › Can I make the post template the same as the main blog template?
- This topic has 19 replies, 2 voices, and was last updated 8 years, 2 months ago by hijump.
-
AuthorPosts
-
January 7, 2016 at 6:53 am #175835hijumpMember
Hi
I'm using a child theme on the Genesis framework and was wondering if there's a way to use the same template on my blog page and individual post pages?Here's the main blog page: http://shineoffline.com/blog/
and here's a post page: http://shineoffline.com/2015/12/20/shine-christmas/Basically I need to use the header image from my blog page on all my post pages. Without the header image my white logo doesn't show up properly, unless I make the post background a custom colour (grey in this case).
Many thanks
http://shineoffline.com/blog/
BenJanuary 7, 2016 at 6:56 am #175836Brad DaltonParticipantJanuary 7, 2016 at 7:06 am #175840hijumpMemberHi Brad
I've used a slider on the homepage but it's an animated gif on the blog page.
There isn't an option in my child theme to edit the Single Post single.php file, so I can't alter the template.
Thanks
January 7, 2016 at 7:30 am #175841Brad DaltonParticipantYou can hook it in using the
is_singular('post'))
Or
You can create a single.php template file and add the code directly to the file.
How did you add it to the blog page template?
January 7, 2016 at 7:34 am #175842hijumpMemberI copied the code below from one of the other page template files to the 'page_blog.php' file:
add_action( 'genesis_after_header', 'kickstart_pricing_before' );
// Add before content section
function kickstart_pricing_before() {
if ( is_active_sidebar( 'lean-pricing' ) ) {
genesis_widget_area( 'lean-pricing', array(
'before' => '<div id="lean-pricing" class="lean-pricing before-content widget-area"><div class="wrap">',
'after' => '</div></div>',
) );
}
}genesis();
January 7, 2016 at 7:51 am #175843Brad DaltonParticipantJanuary 7, 2016 at 7:55 am #175845hijumpMemberIn my child theme (Kickstart by Lean Themes).
Like I say there's no single.php file in the child theme so I'll try creating one using your tutorial above.
Many thanks for your help
January 13, 2016 at 8:02 am #176369hijumpMemberHi Brad
Sorry to bother you again! I'm still struggling with this single post template.
I've followed the instructions in your tutorial (http://wpsites.net/web-design/basic-single-post-template-file-for-genesis-beginners/) but am now unsure what code to add to the single.php file to create the header image.
Am I right in thinking it's related to the 'before content widget area'?
I've tried copying and pasting the code from the other page templates, eg. archive.php, but nothing is working. I suspect I need to add some code snippets to the '.custom-single' code in the style.css file?
Just to clarify, I'd like these post pages (http://shineoffline.com/2016/01/12/running-naked/) to have the same header image as this page: http://shineoffline.com/blog/
Apologies - I know this is probably very simple stuff but I'm a complete newbie and am learning WP using trial and error.
Any help would be greatly appreciated.Ben
January 13, 2016 at 8:06 am #176370Brad DaltonParticipantThe blog page template displays an archive of posts which is not like a single posts page. What is it about the blog page template that you want on single posts?
January 13, 2016 at 8:26 am #176372hijumpMemberI need to replicate the header image. The single post pages don't have one and consequently the white company logo doesn't show up properly.
ThanksJanuary 13, 2016 at 8:35 am #176375Brad DaltonParticipantYou can use the same code for the blog page header and add it to your single.php template file
or
Add the
is_singular('post'))
conditional after the function and use the code in your functions file.
January 13, 2016 at 9:19 am #176379hijumpMemberWhen I copy all the code from the page_blog.php file into the single.php file I get this
A header area has been added but there's no image inside it.
Any idea what I'm doing wrong?
January 13, 2016 at 10:21 am #176380Brad DaltonParticipantIt it works in your child themes blog page template, it should also work in your single.php file but why don't you use the Custom Header function to add your header image?
January 13, 2016 at 11:09 am #176385hijumpMemberCould you explain how I do that please?
January 13, 2016 at 11:17 am #176387Brad DaltonParticipantJanuary 13, 2016 at 12:18 pm #176390hijumpMemberUsing this tutorial, I've just pasted the following code (with relevant image URL) at the bottom of my child theme's style.css file:
.single-post.full-width-content .site-header {
background: url("images/general-pics.gif") no-repeat scroll 0 0 transparent;
}but no joy. Is there something else I need to do?
January 13, 2016 at 1:11 pm #176398Brad DaltonParticipantTry this but add the PHP to your single.php file http://wpsites.net/web-design/add-custom-header-to-home-page-only-in-genesis/
January 13, 2016 at 1:24 pm #176401hijumpMemberThanks Brad. Can't access all the content in that tutorial however. Do I need to register to view it?
January 13, 2016 at 1:42 pm #176404Brad DaltonParticipantSorry, thought that was a public post but was logged in when i viewed it. If you want a coded template which includes a custom header, you'll find several which are available for members which requires registration.
January 13, 2016 at 2:01 pm #176408hijumpMemberI've just registered but haven't received login info yet. Would you be able to activate the account?
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.