• 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

How do I create custom templates for singles?

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 › How do I create custom templates for singles?

This topic is: not resolved

Tagged: Custom fields, custom post types, singles

  • This topic has 2 replies, 3 voices, and was last updated 10 years, 3 months ago by Brad Dalton.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • April 10, 2015 at 6:19 pm #147419
    bobdobbs
    Member

    I've created a CPT and I'd like to customize the markup.

    I'm familiar with the usual way of templating CPT singles: copying single.php, removing the default loop and creating a custom loop with a custom instance of WP_Query.
    However, the genesis single just has the call to genesis().

    I did find this resource:

    How to create a Custom Template In Genesis


    In this tutorial the author gives a technique for unhooking the default genesis loop and then adding passing in a customized args array to a loop.
    However, that doesn't give control of templating, so it isn't so useful where there are custom fields, which is typical for CPT's.

    April 10, 2015 at 9:46 pm #147441
    Ren Ventura
    Member

    You can create a single-{post_type}.php template. In that template, the only thing that is technically required is the genesis() call at the end. Other than that, you can modify everything via Genesis hooks. If you need to change the default markup, you can do that too by just removing the default loop and adding your new markup. To include custom fields, you call get_post_meta(). Here's an example template:

    
    <?php
    
    remove_action( 'genesis_loop', 'genesis_do_loop' );
    add_action( 'genesis_loop', 'custom_genesis_loop' );
    function custom_genesis_loop() {
    
    	//* Your markup here
    
    }
    
    genesis();
    

    Web & Software Developer & Blogger | RenVentura.com | Follow Me on Twitter @CLE_Ren

    April 11, 2015 at 1:56 am #147458
    Brad Dalton
    Participant

    Here's a single.php file already coded

    You can learn more here https://codex.wordpress.org/Template_Hierarchy#Single_Post_display


    Tutorials for StudioPress Themes.

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

© 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