WordPress support from our community
Tagged: archive, Twentyten
This topic contains 0 replies, has 2 voices, and was last updated by Steve 6 years, 5 months ago.
along with every post on a certain site i manage, i have a Custom Field name=”portfolio-image” and Value=”http://www.mywebsite.com/wp-content/uploads/image1.jpg”
i want these images from the custom fields to appear on my archive pages along with each post title and excerpt.
in my twentyten child theme, this is the code from my category.php page: http://pastebin.com/Ap6Kt3Av. what do i put in there and where to make that happen? please advise. thanks in advance!
@jake— Use get_post_meta to pull and display custom fields.
@steve – how come not get_post_custom_values?
i have this code elsewhere in the site: http://pastebin.com/b4nHYs9a
still, either way, how do i incorporate the code into the category.php code? php is not my forte 🙁
on a related note, how do i paste code in here and get it to show? i tried the backticks, but no dice.
get_post_custom_values is really for custom fields that contain an array. However, your example shows how you can use it by getting the first (and only instance) in the array: .
Read the first two paragraphs of the codex.
Have you tried your get_post_custom_values code in your category.php page? Seems like it would work.
You must be logged in to reply to this topic.
WordPress NYC Community is proudly powered by WordPress and BuddyPress
Do you want to speak at our Meetup? >