• jlknauffwildfiremgcom

    (@jlknauffwildfiremgcom)


    I’m trying to display info from a custom field within the template. I’ve tried this:

    <p><?php the_meta(); ?></p>

    But it outputs this:

    <p></p><ul class="post-meta">
    <li><span class="post-meta-key">subtitle:</span> Some test info</li>
    </ul>

    How do I go about getting it to just output the info from the field?

Viewing 1 replies (of 1 total)
  • seven26

    (@seven26)

    try this:
    <?php $key=”subtitle”; echo get_post_meta($post->ID, $key, true); ?>

    it will display the content of the custom key if it is set

Viewing 1 replies (of 1 total)
  • The topic ‘Need help w/ custom fields in theme file’ is closed to new replies.