• 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

Creating multiple post templates

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 › Creating multiple post templates

This topic is: resolved
  • This topic has 2 replies, 2 voices, and was last updated 11 years, 10 months ago by Rellek.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • August 21, 2013 at 1:43 pm #58003
    Rellek
    Member

    I have a site where I want posts in certain categories to have a different layout than the rest. I found a solution using get_template_part and creating two single.php template files.

    I am just curious to know if there is an easier/different way to approach this. Here is the code that I am using currently in my single.php file

    <?php 
    
    if (in_category('6')) {get_template_part( 'theme-single' );
    
    }
    
     else {get_template_part( 'single-content' );
     }
    
    ?>

    Thanks


    Rellek Designs

    August 21, 2013 at 4:44 pm #58055
    Brad Dalton
    Participant

    You can select the layout on the edit screen of a post or use custom PHP code to change the layout in your child themes functions.php file:


    Tutorials for StudioPress Themes.

    August 22, 2013 at 8:05 am #58186
    Rellek
    Member

    Thanks Brad! I will add this to my site to simplify things.


    Rellek Designs

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Creating multiple post templates’ 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

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