• Resolved Anrkist

    (@anrkist)


    …with a catch. I’m trying to pull the custom field values into a page separate from the posts.

    Getting the_title and the_content works perfectly, however the custom field is not posted.

    [Code moderated as per the Forum Rules. Please use the pastebin]

    I’ve created custom posts called jobs and within those custom posts are a custom field called testJobs. Ideas? Everything here works except the custom field output.

    http://ww.wp.xz.cn/extend/plugins/custom-field-template/

Viewing 1 replies (of 1 total)
  • Thread Starter Anrkist

    (@anrkist)

    Hah. Success. I knew the main issue was post->ID, as far as I know, that calls to the current post/page your on.

    Replace:
    <?php global $wp_query; $postid = $wp_query->post->ID; echo get_post_meta($postid, 'testJobs', true);?>

    With:
    <?php echo get_post_meta(get_the_ID(), 'testJobs', true);?>

    Hope this helps someone else. Now on to my new problem… how to turn testJobs (file upload) into a link and not just the ID of the file.

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Custom Field Template] Getting custom fields from a custom post…’ is closed to new replies.