Forums

Page id on custom fields? (5 posts)

  1. jasjoerii
    Member
    Posted 1 year ago #

    Hi,

    I want to put an page id in the following code.
    <?php echo get_post_meta($post->ID, 'home-afbeelding', true); ?>

    So $post->ID has to be a page id I can choose myself, but i can't get this to work.

    Can anybody help me?

  2. Jonas Grumby
    Member
    Posted 1 year ago #

  3. jasjoerii
    Member
    Posted 1 year ago #

    Yes, I also thought so, but doesnt it work different, when You're using pages in stead of Posts?

  4. Jonas Grumby
    Member
    Posted 1 year ago #

    One reason your code doesn't work is because you have to specify the key name and then what value you are looking for on what page. See the examples on that page.

  5. jasjoerii
    Member
    Posted 1 year ago #

    I already did that. THE key: home- afbeelding and the value which I did specify is à link to wn image. But it still doesnt work.

Topic Closed

This topic has been closed to new replies.

About this Topic