Hi everyone,
I have a section of code that I need to add a line to, but every time I do it screws everything up and renders the page blank. It’s entirely possible I’m just doing it wrong, so I figure you guys may be able to add some definitive
Here is the existing code:
[php] <?php }
//if has photos, display photos tab content
if( $has_photo) { ?>
<?php
$i = 0;
//foreach listing photo, create a javascript img object for hover over image change
foreach($listing->photos as $photo) {
echo “”;
$i++;
}
?>
<?php $j=0;
//display each one of building photos
foreach ($listing->photos as $photo) {?>
<?php $j++;
}?>
<?php }?>
[/php]
What I’m trying to do is add a line of code so that in the event there is no photo, to display the default photo I have. I believe the line of code should look something like this:
[php] else
$imgUrl = “/wordpress/wp-content/themes/realestate_2/ygl-assets/images/nophoto.gif”;
[/php]
My question is… 1) IF correct, where exactly should that line of code be placed? and 2) is there anything else needed to make that line of code work beyond what I’ve posted here (header etc)?
If anyone can help me by replying with a couple lines of code I can copy and paste back into my site to get this over with I’ll gladly shoot you $15 via paypal so you can go buy yourself some lunch or coffee or something. I’m at the end of my rope!
Thanks!!