WordPress.org

Ready to get started?Download WordPress

Forums

custom fields from specific post (with headway theme) (4 posts)

  1. skritz
    Member
    Posted 3 years ago #

    Hello,

    I'm using the headway theme and I want to add custom fields.
    I use the following code to show the custom fields
    <?php echo get_post_meta($post->ID, 'customfield1', true); ?>
    I a non-Headway WordPress everything is fine.
    But in my Headway-Theme I have a page. And the content in that page comes from a post. So I want to change the code something like
    <?php echo get_post_meta(p=2337, 'customfield1', true); ?>

    And of course, it did not work.

    Has anyboy an Idea what I am doing wrong

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    Have you tried using:

    <?php
    $my_id = 2337;
    echo get_post_meta($my_id, 'customfield1', true); ?>
  3. skritz
    Member
    Posted 3 years ago #

    Oh my dear,

    it can be so easy. Working perfectly.

    Thanks a lot

  4. esmi
    Forum Moderator
    Posted 3 years ago #

    No problem :-)

Topic Closed

This topic has been closed to new replies.

About this Topic