Pulling in custom field within loop on category page
-
Hi there,
I’m trying to pull a custom field from my posts from within the loop on my category.php template. I’m using $post->ID to retrieve the post ID within my get_post_meta() function – but it’s not working.
I’ve tested it by actually setting a value for the post ID, e.g. 1 and it works fine then. Strange I haven’t had this problem pulling in meta data on posts or pages?
I’ve also tried setting a variable, e.g.
$link_ID = $post->ID, and then using this new variable in the get_post_meta() function. But gain , no joy. Weird ;cos when I echo the value of the $link_ID variable it does seem to be picking up the correct value!!
Any help appreciated.
regards
Dan
- The topic ‘Pulling in custom field within loop on category page’ is closed to new replies.