Forums

Page Custom Field (2 posts)

  1. stiwdio
    Member
    Posted 5 months ago #

    Hi I wonder if anyone can help me;

    Ive been looking around but cant fidn the answer;
    Basically I want to display a Custom Field of a PAGE, not Post;

    How do I go about this? Is it by page ID? as I know the page ID (which is 9)

    Ive created a template and want the user to able to update the custom field, called Welcome Text , when they update that page;

    I just dont know the code to call the custom field for that page.

    Hope that makes sense, Any help greatly appreciated

  2. vtxyzzy
    Member
    Posted 5 months ago #

    I think you want to use get_post_meta(). It will work for Pages as well as Posts.

    Something like this:

    $myvalue = get_post_meta(9,'my-custom-field',true);

Reply

You must log in to post.

About this Topic