/ Published in: PHP

declare all custom fields first
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php global $post; $bg_img = get_post_meta($post->ID, 'bgimg', 1); $heading = get_post_meta($post->ID, 'mainheading', 1);?> <div class="int-head-pic" style="background:url(<?php echo $bg_img; ?>) no-repeat;" > <h2 class="mainheading"><?php echo $heading; ?></h2>
Comments
