Soldato
I'm currently trying to get a page to display posts from a certain category correctly.
http://www.afowler.co.uk/adventures/
This is a wordpress page with a custom loop, so it displays only posts from category 10. This works fine so far, and pagination works correctly as well. However, when I click on the title of a post to read the entire post, it simply displays the list of posts again, not the expanded post.
This is what the page template looks like;
Any ideas of where I'm going wrong? I don't know PHP so am having problems tracking down the issue.
http://www.afowler.co.uk/adventures/
This is a wordpress page with a custom loop, so it displays only posts from category 10. This works fine so far, and pagination works correctly as well. However, when I click on the title of a post to read the entire post, it simply displays the list of posts again, not the expanded post.
This is what the page template looks like;
PHP:
<?php
/**
* @package WordPress
* @subpackage Default_Theme
*/
/*
Template Name: PageofPosts
*/
?>
<?php get_header(); ?>
<script type="text/javascript">
var main_nav = "adventures";
navigation();
</script>
<div id="content" class="narrowcolumn">
<?php /* Page content */ ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<div class="entry">
<?php the_content('<p class="serif">Read the rest of this page »</p>'); ?>
<?php if ( comments_open() ) : comments_template(); endif; ?>
<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
</div>
</div>
<?php endwhile; endif; ?>
<?php /* Post list */ ?>
<?php
$temp = $wp_query;
$wp_query= null;
$wp_query = new WP_Query();
$wp_query->query('cat=10&posts_per_page=3'.'&paged='.$paged);
while ($wp_query->have_posts()) : $wp_query->the_post();
?>
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>
<div class="entry">
<?php the_attached_image(); ?>
<?php the_content('Read the rest of this entry »'); ?>
</div>
<p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
</div>
<?php endwhile; ?>
<div class="navigation">
<div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
</div>
<?php $wp_query = null; $wp_query = $temp;?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Any ideas of where I'm going wrong? I don't know PHP so am having problems tracking down the issue.