2

I'm having to work with a site using a genesis child theme and want to overwrite the default single post layout. I've created a new single.php file which I've upladed to the childtheme but genesis doesn't seem to be having any of it!?

I've tried to unset the default single.php file through the child theme functions.php but again this has had no effect whatsoever.

Can anyone please tell me how I scrap the default page template and replace it with my own?

bigdave
  • 337
  • 3
  • 15
  • 1
    You'll get a fast answer here: http://wordpress.stackexchange.com/ - However, because its a pre-built theme, with my knowledge you actually can't edit it: if you do, when an update comes out for it, your files are overwritten anyway! – Jaquarh Mar 08 '16 at 13:52
  • The child theme is unaffected by updates. There are MANY hooks and filters to change the single page template to anything, any layout. Read your Genesis documentation on my.studiopress.com – Christina Mar 20 '16 at 16:11

2 Answers2

2

Genesis is an excellent framework but certain parts of the documentation can be a little lacking. If you want to customise your single post template, you can do the following

Create a file in your child theme folder called single.php Make sure the last line in this file is the following:

genesis();

Use the Genesis theme hooks and filters to manipulate your markup. The visual theme hook guide is an excellent resource for this. See: https://genesistutorials.com/visual-hook-guide/

So, if you wanted to modify the entry content, you could do something like this:

remove_action('genesis_entry_content', 'genesis_do_post_content');
add_action( 'genesis_entry_content', 'custom_entry_content' ); // Add custom loop

function custom_entry_content() {
    //Custom Entry Content
}

This is merely a starting point for modifying your code but there are many useful hooks and filters. All of the markup modification in Genesis is handled through hooks and filters so if you're trying to change the post meta for example, there'll be a filter for that.

Andrew M
  • 755
  • 9
  • 15
0

If you overwrite the single.php file in the child theme with your own, just be sure to end the new single.php file with the line genesis(); If you don't, you will get a blank page when viewing single posts.

jer0dh
  • 384
  • 3
  • 6