The code in question is this:
<?php }else{ ?>
<div class = 'reddit-image pull-left' style = 'width:180px'>
<img src = "<?php echo get_post_meta( $post->ID, 'wpedditimage', true ); ?>" width = "180px" class="img-rounded">
</div>
<?php } ?>
How would I nest another if/else statement within the current "else"?
try
else {
if() {
// do your stuff
}
else {
// do your stuff
}
}
For more :- http://www.php.net/manual/en/control-structures.else.php
That's... an okay way to do it; However, I'd probably take this route (just my personal preference):
<?php
if {
// do stuff
}
else {
if {
// do stuff
}
else {
echo "<div class = 'reddit-image pull-left' style = 'width:180px'><img src = '" . get_post_meta($post->ID, 'wpedditimage', true ) . "' width = '180px' class='img-rounded'></div>";
}
?>
Make sure not to confuse your single and double quotes! Notice that after you broke back into HTML to define the width and class, you forgot to continue with single quotes instead of double quotes.
To echo multiple things from one echo request...
<?php
echo "Thing one" . "Thing two" . "Thing three";
?>
Notice the .
between your strings.
Good luck!