Help with page to list post information as a table
-
I am trying to build a custom page template for my church site to present links to podcasts and notes on series of sermons.
By using tags in the posts and a custom field in the calling page, I am able to build an HTML table with fields for each sermon’s podcast and study notes. I use
query_posts("tag=$tag&order=asc")
to build the object list (where $tag is the value of the custom field of the calling page. The Loop does all the heavy lifting.My problem is that I cannot find a way to have the calling page display anything except the results of The Loop’s work. I want the page to display an image, then a summary/scope statement on the teaching series, and then the list/table of individual messages.
Can someone please point me to a forum discussion or CODEX section to help me figure out what I’m doing wrong?
Thanks!
Here’s the guts of the template:
<?php $this_id = get_the_ID(); the_content(); // this gets nothing! $page_meta = get_post_meta($this_id, 'Series_Name'); $tag = $page_meta[0]; $posts = query_posts( "tag=$tag&order=asc" ); ?> <?php include(TEMPLATEPATH."/breadcrumbwide.php");?> <table border=1 cellpadding=10> <tr><th>Part No.</th><th>Podcast link</th><th>Notes link</th></tr> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <tr> <td> <?php $post_title = get_the_title(); $regex = '/\d+$/'; preg_match($regex, $post_title, $matches); $part = $matches[0]; echo $part; ?> </td> <?php $id = get_the_ID(); $meta_array = get_post_meta($id, 'Notes_ID'); $notes = $meta_array[0]; $metas = get_post_meta($id, '_podPressMedia'); $uri = $metas[0][0]['URI']; ?> <td><!-- call an MP3 player loaded with the podcast --></td> <td><?php if($notes > 0) { printf("<a href='https://localhost/?p=%d', target='_new'>View the notes</s>", $notes); } else { echo "Notes unavailable"; } ?> </td> </tr> <?php endwhile; else: ?> <p><?php _e('Sorry, no posts matched your criteria.'); ?></p> <?php endif; ?> </table>
- The topic ‘Help with page to list post information as a table’ is closed to new replies.