WordPress Custom Fields template usage

Last updated on

To get a custom field named color.

get_post_meta(get_the_ID(), 'color', true);

If you’re using the Advanced Custom Fields plugin, try

get_field('field_name');
1 Star2 Stars3 Stars4 Stars5 Stars

Let me know if this helped. Follow me on Twitter, Facebook and YouTube, or 🍊 buy me a smoothie.

p.s. I increased my AdSense revenue by 68% using AI 🤖. Read my Ezoic review to find out how.

Leave a Reply

avatar
  Subscribe  
Notify of