Custom Fields in Wordpress


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. // Syntax for custom field call //
  2.  
  3. <?php get_post_meta($post_id, '$key', $single); ?>
  4.  
  5.  
  6. // Example, First set Custom Field in "Create Post" or use "Custom Field Template"-Plugin. In this case I create the field "CustomPower". Then call the field via get_post_meta. Easy :) //
  7.  
  8. <p class="whatever"><?php echo get_post_meta($post->ID, 'customPower', true); ?></p>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.