WordPress.org

Ready to get started?Download WordPress

Forums

Displaying Custom Fields in Page Templates? (6 posts)

  1. raisinlove
    Member
    Posted 6 years ago #

    Hi, I've added custom fields to my pages (not posts) and I tried using the "the_meta()" function in the page.php template but it isn't displaying my custom field data. Is this a bug? If not, is there a way to make this work?
    thank you!

  2. moshu
    Member
    Posted 6 years ago #

  3. raisinlove
    Member
    Posted 6 years ago #

    I did place the_meta() within the loop, but my mistake was that I removed the wordpress header call since I was using my own template system.
    The instructions are to include the WordPress header and set USE_THEMES to false, which I have now done, but it's still not working: the_meta() is not displaying my Custom Fields. Plus, despite having set the use of Worpress themes to false, I have to manually remove the header from the default template as it is being displayed anyway.

  4. moshu
    Member
    Posted 6 years ago #

    Then you are doing something wrong. Just tested and it works.

    I don't know what your "template system" is.

  5. raisinlove
    Member
    Posted 6 years ago #

    My template system is actually an existing CMS into which I am integrating WordPress.

    I'll test it with the original page.php file

  6. raisinlove
    Member
    Posted 6 years ago #

    I was doing something wrong alright, I remade my custom page.php template and it works fine. Thanks for testing it.

Topic Closed

This topic has been closed to new replies.

About this Topic