Displaying custom field data from a page on another page
-
I want to display data from a custom field on a page and I have found that the following is one way to do it:
<?php echo get_post_meta($post->ID, “myFieldName”, true) ?>
This hasn’t worked and I think it’s because I’m not in the loop — so $post->ID doesn’t mean anything. The custom field data I want isn’t really from a post, per se, but from a static page. How can I display it on another page?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Displaying custom field data from a page on another page’ is closed to new replies.