Code help
-
Wonder if someone can show me the error of my ways;
<?php if ( get_post_meta($post->ID, 'image-url', true) ) { $post_back = get_post_meta($post->ID, 'image-url', $single = true); echo '<div class="image-holder" style="background: url(' . $post_back . ') no-repeat; background-size: 100%;"> <div class="post-info" style="height: auto;"> <p class="caption" style="width: 558px; padding-left: 12px; display: block;"> Caption to go here</p> </div> </div> '; } else { ; } ?>where it says Caption to go here, I’d like it to put in the caption from the custom field;
<?php echo get_post_meta($post->ID, ‘image-caption’, true); ?>
But I know it needs to be formatted differently within the if else statement as it’s not allowing me just to add that code in;
if anyone can help that be great
The topic ‘Code help’ is closed to new replies.