Use Custom Fields with WordPress?

Do you ever use custom fields with your posts and have trouble getting them to display? Well here’s a quite little line of code to add into the post loop to get them to display.

[html]<?php echo get_post_meta($post->ID, ‘custom field name here’, true); ?>[/html]

It really is that simple!!

AJ Morris Avatar

4 responses to “Use Custom Fields with WordPress?”

  1. Gavin Avatar
    Gavin

    Hi AJ. It may be simple in wordpress, but how do I get them to work in Headway? I’ve been trying for a over a week, as a newbie user of Headway to get an idea of incorporating custom fields into the Headway Theme, and particularly how to use the Advanced Custom Fields plugin. I thought I’d try Headway for a new client site and as its a learning curve, some aspects are proving problematic.

    Any help appreciated with what appears a fantastic tool.

    Thanks – Gavin.

  2. AJ Morris Avatar
    AJ Morris

    Hi Gavin,

    It’s actually used the same way. You just need to use a PHP leaf.

  3. Ahmed Hussein Avatar
    Ahmed Hussein

    Hello AJ. I’m using Headway 3.5.5 and new to wordpress. How and Where would I use this code?

    Thank you

  4. AJ Morris Avatar
    AJ Morris

    Add a custom code block inside the Visual Editor in the wrapper you wish, and add that line of code. Make sure you replace the first argument with whatever you called your custom field.