Displaying custom fields in single.php

Community Forums Forums Design Tips and Tricks Displaying custom fields in single.php

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  lucaslem 1 year, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #58109

    edharris
    Participant
    Post count: 3

    I’m looking for some advice working with displaying custom post types and associated custom fields. I’ve been working on a simple example to play around with this: I have a custom post type called “jobs” with a custom field called “application_deadline” which contains a deadline date. Everything works great on the back end – I can create new “Jobs” with a description in the content editor and a date in the Application Deadline field. My aim is to build customized version of single.php to display individual job posts, including the custom field.

    I have created a single-job.php file which I have successfully used to force the full width layout for the job posts, and to remove post author information. My question is how to display the custom field “Application Deadline” in addition to the post content?

    The single-job.php file currently contains:

    <?php
    /**
    * Custom job post type single post template
    */

    /** Force full width content layout */
    add_filter( ‘genesis_pre_get_option_site_layout’, ‘__genesis_return_full_width_content’ );

    /** Remove the author box on single posts */
    remove_action( ‘genesis_after_post’, ‘genesis_do_author_box_single’ );

    genesis();

    #62830

    lucaslem
    Participant
    Post count: 88

    Would love to know more about this as well…

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

You must be logged in to reply to this topic.