Forums

[resolved] Issues displaying content of Custom Fields (3 posts)

  1. databell96
    Member
    Posted 5 months ago #

    I made a custom field for a shorter version of my posts' title called short_title. Problem is getting it to appear in my post just comes across with fatal errors. I've tried a number of approaches but nothing seems to click. Here's my latest:

    <?php echo get('short_title'); ?>

    That just brings up a fatal error. So how can I display it?

  2. alchymyth
    The Sweeper
    Posted 5 months ago #

    try to search the web for related information in the codex:
    for instance with search term: 'codex custom fields'

    http://codex.wordpress.org/Custom_Fields
    http://codex.wordpress.org/Function_Reference/get_post_meta

    <?php echo get_post_meta($post->ID,'short_title',true); ?>

  3. databell96
    Member
    Posted 5 months ago #

    Thanks! Your suggestion worked.

Reply

You must log in to post.

About this Topic