• 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

Custom Post 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 › Custom Post Template

This topic is: resolved

Tagged: layout, page, posts, template

  • This topic has 3 replies, 1 voice, and was last updated 10 years, 11 months ago by Porter.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • February 13, 2015 at 4:35 pm #140778
    Porter
    Participant

    What's the most efficient way to go about making a custom post template? To be clear, I want this to be for every "post" (not page), for every category, not just one. My default page layout is full, for many other pages of my site.

    I see that the page uses the single.php file. All I need to do is use the content-sidebar layout for my posts page. Should I create a custom single.php for my child theme, or is there a simple way to make these edits with a hook or filter in functions.php?


    Buy me a beer? | Try DigitalOcean VPS Hosting

    February 13, 2015 at 7:08 pm #140798
    Porter
    Participant

    I have this thus far:

    //Set layout for all "post" pages.
    if (is_singular('post')) {
    	add_filter('genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar');
    }

    That alone in functions.php does nothing however, and I believe I need to add it through a specific hook to change the layout. Any ideas which hook I need, or if I'm on the right track?


    Buy me a beer? | Try DigitalOcean VPS Hosting

    February 13, 2015 at 7:33 pm #140799
    Porter
    Participant

    I finally got it, thanks to a bit of code I saw on Brad's site:

    //Set the layout for all "posts" pages. If desired, specify parameters for specific categories. 
    add_filter( 'genesis_pre_get_option_site_layout', 'full_width_layout_single_posts' );
    function full_width_layout_single_posts( $opt ) {
    	if (is_single()) {
    		$opt = 'content-sidebar'; 
    		return $opt;
        } 
    }

    Buy me a beer? | Try DigitalOcean VPS Hosting

    February 13, 2015 at 8:06 pm #140805
    Porter
    Participant

    Just for the sake of staying informative - if anyone sees this thread, you need to use is_singular when specifying parameters, not is_single.


    Buy me a beer? | Try DigitalOcean VPS Hosting

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 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