Customising single post template for a CPT with custom fields

Community Forums Forums Design Tips and Tricks Customising single post template for a CPT with custom fields

This topic is: not resolved

This topic contains 3 replies, has 3 voices, and was last updated by  bongoman 1 month, 1 week ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #117307

    bongoman
    Member
    Post count: 1

    Hi there

    I’m getting a little tripped up on the best way to work with the Genesis hooks and filters.

    Specifically I have a custom post type with a bunch of custom fields and am currently working on the single post template for this CPT.

    At this stage I’m just basically adding my custom functions to display my custom fields to the genesis_entry_content hook.

    But I need to be more precise in my layout on this template. I’m wanting to use the genesis column classes but am a little unclear on how to do this. For example, I’m wanting to create a couple of columns and display the_content() in one, maybe with some custom fields in that same column, and to also display my other custom fields in a second column.

    Any suggestions on how to get started with this would be appreciated.

    #117664

    Jon Schroeder
    Member
    Post count: 29

    First, you’ll want to be just editing this specific template. So the file to use would be something like single-yourposttype.php, and it should be located in the same folder as your child theme’s functions.php file.

    More on that here: http://codex.wordpress.org/images/1/18/Template_Hierarchy.png

    The content of this file should look something like this:

    ——————————-
    <?php

    // your functions here, using hooks and filters

    genesis();

    ——————————-

    So far as using the Genesis column classes are concerned, there are lots of things you can do!
    Here’s more information on using those: http://my.studiopress.com/tutorials/content-column-classes/

    #117693

    braddalton
    Participant
    Post count: 9752

    One solution might be to look at how the AgentPress theme and Listings plugin uses custom fields as they also output in columns and generate meta boxes on single CPT Edit screens.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #118109

    bongoman
    Member
    Post count: 1

    Thanks for the replies, much appreciated. Will look at the AgentPress theme, thanks!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.