Hi all,
I'm trying to figure out what syntax I need to use to make an if statement work with some code I am working with.
Basically I have some custom fields in wordpress pulling into this code but I need the table to only show the parts that have content. Here's the code I have so far and it pull the content in but I need to get an if statement working so that posts that don't have the content don't show the table structure.
<?php $ScheduleGroup = get_group('schedule'); // use the Custom Group name
foreach($ScheduleGroup as $event){ ?>
<?php $semester=get($event['schedule_semester'][1]); ?>
<?php if ( $semester ) : ?>
<h3><?php echo $semester; ?> Schedule</h3>
<table width="500" border="0" cellpadding="8" cellspacing="8">
<tr >
<td width="111" class="tabletitle">Campus</td>
<td width="105" class="tabletitle">Completion Time</td>
<td width="105" class="tabletitle">Days</td>
<td width="105" class="tabletitle">Time</td>
</tr>
<tr>
<td class="tableinfo"><?php echo $event['campusone'][1]; ?></td>
<td class="tablewhite"><?php echo get('schedule_campus_1_completion_time', true); ?></td>
<td class="tablewhite"><?php echo get('schedule_campus_1_days', true); ?></td>
<td class="tablewhite"><?php echo get('schedule_campus_1_time', true); ?></td>
</tr>
</table>
<?php else : ?>
<?php endif; ?>
<?php } ?>
The Groups are duplicatable so that's why the code creates a number . Basically I just need this to work but my syntax is wrong.
<?php $semester=get($event['schedule_semester'][1]); ?>
<?php if ( $semester ) : ?>
<h3><?php echo $semester; ?> Schedule</h3>
<?php else : ?>
<?php endif; ?>