<?php
if ($all_the_tags);
$all_the_tags = get_the_tags();
foreach($all_the_tags as $this_tag) {
if ($this_tag->name == "BOOKS" ) {
?>
<table width="635px" class="category_posts">
<tbody>
<tr style="border-left:1px solid #D1D1D1; border-top:1px solid #D1D1D1; border-right:1px solid #D1D1D1;">
<td class="category_td" style="width:15%; color: #34A9D6; font-size: 13px; text-align: center;"><strong>Volume</strong></td>
<td class="category_td" style="width:73%; color: #34A9D6; font-size: 13px; text-align: center;"><strong>Title</strong></td>
<td class="category_td" style="width:12%; color: #34A9D6; font-size: 13px; text-align: center;"><strong>Views</strong></td>
<tr>
</tbody>
</table>
<?php while (have_posts()) : the_post(); ?>
<table width="635px" class="category_posts2">
<tbody>
<td class="category_td1" style="width:15%;"><span class="vol"><a href="<?php the_permalink() ?>" rel="bookmark" >Volume <?php the_title(); ?></a></span></td>
<td class="category_td2" style="width:73%;"><span class="subtitle"><a href="<?php the_permalink() ?>" rel="bookmark" ><?php echo ShortenTitle(the_subtitle()); ?></a></span></td>
<td class="category_td3" style="width:12%;"><?php the_views(); ?></td>
</tr>
</tbody>
</table>
<?php endwhile; ?>
<?php } else {
// it's neither, do nothing
?>
<!-- not tagged as one or the other -->
<?
}
}
?>
heres the code I keep getting a Invalid argument supplied for foreach() error, it works if i take the while loop outside the foreach but then the table headers will repeat as well and i don’t want the headers outside the if else statement anyone have a clue to how to get this to work?