Custom Single.php file for Custom Post Types

Community Forums Forums Design Tips and Tricks Custom Single.php file for Custom Post Types

This topic is: not resolved

This topic contains 2 replies, has 2 voices, and was last updated by  Nuro 1 year ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #57347

    Nuro
    Participant
    Post count: 1

    Hi,

    how do I create a custom single.php file for my custom post types. My custom post type is “reaction”, so have created single-reaction.php, but not sure how to add the code below, which should display after the content:

    <p><?php the_field(‘reaction_discussion’); ?></p>
    <div><?php the_field(‘reaction_table’); ?></div>

    I’ve seen/read tutorials for page templates but not for the single.php files.

    Thanks!

    #57351

    braddalton
    Participant
    Post count: 9212

    Link to your site please.

    Try this http://www.briangardner.com/portfolio-page/


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #57362

    Nuro
    Participant
    Post count: 1

    I haven’t uploaded it yet… using MAMP.

    <?php
    /**
     * The custom portfolio post type single post template
     */
    
    /** Remove the post info function */
    remove_action( 'genesis_before_post_content', 'genesis_post_info' );
    
    /** Remove the author box on single posts */
    remove_action( 'genesis_after_post', 'genesis_do_author_box_single' );
    
    /** Remove the post meta function */
    remove_action( 'genesis_after_post_content', 'genesis_post_meta' );
    
    ?>
    
    <p><?php the_field('reaction_discussion'); ?></p>
    <div><?php the_field('reaction_table'); ?></div>
    
    <?php
    
    genesis();

    This works except it shows the custom field content above the header… Any tips on getting it right behind the content. Tried different hooks but couldn’t get it to work.

    Thanks!

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

You must be logged in to reply to this topic.