Display Specific Post based on category
-
I am trying to create a template page to serve as category pages with an else if to display specific post based on category. New to php, so i think my syntax is incorrect. This is what i have pieced together:
<?php get_header(); ?>
<div id=”content” class=”narrowcolumn”><?php if (is_category(‘3’) ):
?><?php query_posts(‘p=17’); ?>
<?php while (have_posts()) : the_post(); ?>
<h4><?php the_title(); ?></h4>
<?php the_content(); ?><?php } elseif (is_category(’13’) ):
<?php query_posts(‘p=11’); ?>
<?php while (have_posts()) : the_post(); ?>
<h4><?php the_title(); ?></h4>
<?php the_content(); ?><?php else : ?>
//whatever goes in here
<?php endif; ?>Displays blank page. Unsure what I am doing wrong. I will continue searching, but it seems the search function on the wp site is not working right now making it exceedingly difficult:-/ any help GREATLY appreciated
- The topic ‘Display Specific Post based on category’ is closed to new replies.