I want to use WP as a CMS, where one of the part of the site is a blog, called blog, with all the post there and the other part of the site are WP Pages actually.. so I would have Home – Blog – About ..
for the blog part, I make a WP Page called blog, with a sug as blog, and which I link to a template for that specific page.. on my permalink structure I have putted for the custom /blog/%postname%/
my template is as such (it takes the normal loop, just added query_posts(‘cat=-0’)
<?php /* Template Name: tpl_Blog */ get_header(); query_posts('cat=-0') ?> <div id="content" class="narrowcolumn"> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="post" 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_content('Read the rest of this entry »'); ?> </div> <p class="postmetadata"><?php the_tags('Tags: ', ', ', ''); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?> </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 else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here. <?php include (TEMPLATEPATH . "/searchform.php"); ?> <?php endif; ?> </div> <?php // get_sidebar(); ?> <?php get_footer(); ?>
it works pretty well actually
let say it shows me the 3 last post called H, G, F
but I have a problem when I try to get it paginated..
when I hit the “older entries” link, it well direct me to /blog/page/2/ fine
the post listed are the same, the last 3 post H, G, F and NOT post E, D, C as I would have expected..
any ideaof what I’m doing wrong?
thank you VERY much in advance
- The topic ‘WP CMS, list of the post as a blog page’ is closed to new replies.