spartana
Member
Posted 2 years ago #
I'm working on a news portal-esque site and have assigned a custom field to each article ('byline') with the writer's name. How do I call this custom field in my singlepost.php and index.php within my template? I've tried a few suggestions for code, but none have worked. Thanks in advance for helping out a noob.
spartana
Member
Posted 2 years ago #
I have already read that inside and out, bro. Check my site. For example, under the title "Hockey team delivered wake-up call," I would like it to read "Posted on 2009-12-22 by CUSTOM FIELD VALUE." How do I call that value with code?
What's the name of the key for that custom field?
spartana
Member
Posted 2 years ago #
Try `Posted on <?php the_date('Y-m-d'); ?>
by <?php echo get_post_meta( $post->ID, 'byline', true );?>`
spartana
Member
Posted 2 years ago #
It works. Thanks. I was omitting the "echo."