Support » Themes and Templates » WP CMS, list of the post as a blog page

  • Resolved freeriders



    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’)

    Template Name: tpl_Blog
    	<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 &raquo;'); ?>
    				<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 »'); ?>
    		<?php endwhile; ?>
    		<div class="navigation">
    			<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
    			<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></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; ?>
    <?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


Viewing 8 replies - 1 through 8 (of 8 total)
  • What is this zero doing?

    well I got this somewhere I think, it is to list ALL the categories..

    do I am wrong?

    how would you do?

    If I recall correctly, query posts and pagination don’t work well together. I would use a plugin like CQS instead to control the number of posts that appear.

    ok thank you, it is like I have used query_posts(‘page_id=myidpage’); and it worked for that purpose

    Did you find a solution to this problem? I have been implementing a similar theme and have been having similar problems. Although, I am no getting any navigation links at all.

    I am not sure that CQS will solve the problem since there is no selection is_page with it and our blog page is a Page with its own template.


    yes I have used query_posts(‘page_id=myidpage’); and it worked for that purpose, if you have any problem, buzz me


    I believe that I found what is a bug when you have a template named the same as the actual Page title. My template name (in the PHP comments within the file) and the Page name were both “Blog”. Once I changed the name of the template to “BlogTmpl” the navigation links magically appeared.

    ah ok, possible, I always name my template with the _tpl to be sure what they are at the first see.. I find it a good convention for naming

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘WP CMS, list of the post as a blog page’ is closed to new replies.