If statement
-
Below I post my code for my loop, but I need to use and if statement for ” class=”download rounded-corner”>Download PDF so that if no pdf is uploaded there is no download button. I have tried a few things but just get errors. Any help with this would be great?
<?php query_posts(‘post_per_page=-1&post_type=properties’);
while (have_posts()) : the_post(); ?>
<article class=”property-wrap”>
<?php
$contact_name = getData(“contact_name_field”); // The cover image field value
$contact_email = getData(“contact_email_field”); // The cover image field value
$property_address = getData(“property_address_field”); // The book title text field value
$size = getData(“property_size_field”); // The cover image field value
$tenants = getData(“property_tenants_field”); // The book title text field value
$download = getData(“property_pdflink_field”);
?>
<img src=”http://dummyimage.com/280×150/333/fff&text=property image” /><h2><?php the_title(); ?></h2>
<lable>Location</lable>
<p><?php echo $property_address ?></p>
<lable>Size</lable>
<p><?php echo $size ?> sq ft</p>
<lable>Co-Tenants</lable>
<p><?php echo $tenants ?></p>
<lable>Contact</lable>
” class=”property-contact”>
<span></span><?php echo $contact_name ?>
” class=”download rounded-corner”>Download PDF
” class=”more-info rounded-corner”>More Info</article>
The topic ‘If statement’ is closed to new replies.