I want to make a category template for this new site:
http://www.archos-video.com
I want the template to first call a page with the same name as the category, then rewind and call the posts in that category. That way each category will have a unique introduction paragraph controlled by a page in the WP admin.
Here's what I have so far:
PHP Code:<?php get_header(); ?>
<div id="contentwrap">
<?php include(TEMPLATEPATH."/featured.php");?>
<div id="content" class="narrowcolumn">
<div class="navigation_small">
<div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
</div>
<?php if (have_posts()) : ?>
<h2 class="pagetitle">Category: <?php single_cat_title(); ?></h2>
<?php $category = get_the_category();?>
<?php query_posts('pagename=$category->category_nicename'); ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post">
<h3 id="post-<?php the_ID(); ?>"><a href="<?php bloginfo('url'); ?>/<?php echo($post->post_name) ?> " rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
<small><?php the_time('l, F jS, Y') ?></small>
<div class="entry">
<?php the_content('<p class="serif">Read the rest of this page »</p>'); ?>
</div>
<h6 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 »'); ?></h6>
</div>
<?php endwhile; ?>
<?php endif; ?>
<?php rewind_posts(); ?>
<?php query_posts('category_name='.$category); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post">
<h3 id="post-<?php the_ID(); ?>"><a href="<?php bloginfo('url'); ?>/<?php echo($post->post_name) ?> " rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
<small><?php the_time('l, F jS, Y') ?></small>
<a href="<?php bloginfo('url'); ?>/<?php echo($post->post_name) ?>" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('playbutton<?php echo($post->post_name) ?>','','<?php bloginfo('stylesheet_directory'); ?>/images/playbutton_flip.png',1)"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/playbutton.png" name="playbutton<?php echo($post->post_name) ?>" width="150" height="150" border="0" id="playbutton" style="float:right;padding-left:10px;" /></a>
<div class="entry">
<?php the_excerpt(); ?>
</div>
<h6 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 »'); ?></h6>
</div>
<?php endwhile; ?>
<div class="navigation_small">
<div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
</div>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
</div>
<?php get_footer(); ?>
Basically I'm getting nothing right now...lol
http://www.archos-video.com/category/captain-euchre/
Now I know my php skills suck so I'm hoping one of you will have the answer for this.
First I I'm pretty sure I have a problem in the query of the page:
Second I think I'm messing up the query for the categoryPHP Code:<?php $category = get_the_category();?>
<?php query_posts('pagename=$category->category_nicename'); ?>
I'm really just shooting blanks at this point so any idea will be welcome.PHP Code:<?php rewind_posts(); ?>
<?php query_posts('category_name='.$category); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>




Bookmarks