I'm working on a theme for teachers with a custom post type, lesson plan. For example: http://www.englishadvantage.info/testblog/lesson/writing-good-toefl-paragraphs-quickly/
The info on the right: Goals, Objectives, and Materials are all generated in meta fields I generated. I don't understand why the Goal is showing, the objectives are showing, but the materials aren't showing even though there is information there:
This is the code for that part of the page:
<div id="goal">
<?php if (!empty($goal)) echo "<h3>Goal</h3>","<br>",$goal; ?>
<?php if (!empty($objective1)) echo"<h3>Objectives</h3>","<br>","•", $objective1;?>
<?php if (!empty($objective2)) echo "<br>","•", $objective2; ?>
<?php if (!empty($objective3)) echo "<br>","•", $objective3; ?>
<h3>Materials</h3>
<?php if (!empty($materials1)) echo "<br>","•", $materials2; ?>
<?php if (!empty($materials2)) echo "<br>","•", $materials2; ?>
<?php if (!empty($materials3)) echo "<br>","•", $materials3; ?>
<?php if (!empty($materials4)) echo "<br>","•", $materials4; ?>
<?php $args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_status' => null,
'post_parent' => $post->ID
);
$attachments = get_posts($args);
if ($attachments) {
foreach ($attachments as $attachment) {
echo "<br>","•";
the_attachment_link($attachment->ID, true);
}
};
?>
</div><!--#goal-->
You'll see one listing under Materials, but that is being picked up by the attachment loop at the end.