Support » Plugins » Displaying Posts inside Pages, almost going fine… HELP!!!

  • Resolved Rodeo Imagination


    Hi all! I need urgent help with these please!

    I have a Categorie “BOOKS” for recent aditions.
    And inside the site I have Pages for static content like “Publications”.

    Problem is I want to display the recently Posts of BOOKS inside the Page “Publications”.

    By far I made it run easily, you can see the Posts showing right after the Page content, here is the site:

    Problem comes in NEXT and PREV links… they won’t work… Is there a way to make this run? Any idea?

    This is the code I am using right after the Page Loop:

    <div id="librostr">
    				<?php query_posts('category_name=Libros'); ?>
    				<?php if (have_posts()) : ?>
    				<?php while (have_posts()) : the_post(); ?>
    								<div id="libros"><?php the_excerpt_reloaded(60, '<img><strong>', 'excerpt', FALSE); ?>	 <span class="bread" STYLE="background-position: left 2px"><a href="<?php the_permalink() ?>" title="Más sobre esta publicación UB"> "<?php the_title(); ?>"</a></span> &nbsp; &nbsp; <span class="bcomment"><?php comments_popup_link('Opina', 'Una Opinión', '% Opiniones'); ?></span> &nbsp; &nbsp; <?php edit_post_link('Editar'); ?>
    				<?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 endif; ?>

    You can see the “Older Entries” Link at the end of the page at the right.

Viewing 4 replies - 1 through 4 (of 4 total)
  • *bump* nobody?



    @shiroujune: Not sure if this is the same problem you’re facing, but from this thread, I picked up what could be a solution for you from this post by Kafkaesqui.

    Apparently the key thing is to add:

    $wp_query->is_archive = true;
    $wp_query->is_home = false;

    after the query at the end.

    Kafkaesqui said:

    (Adding the above)… after the query_posts() are important as they force posts_nav_link() (and so pagination) to work, along with a few other helpful results gained for fooling WordPress into thinking we’re in the archive pages.

    so overall, he/she has said the page should have:

    $limit = get_option('posts_per_page');
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('showposts=' . $limit . '&paged=' . $paged);
    $wp_query->is_archive = true; $wp_query->is_home = false;

    MOSEY!!!! thank you lots!!! and of course Kafkaesqui, it worked great =) now I just have to aim a certain category there.

    Again thanks, for having a time to look at my problem ^_^
    I’ll set this as resolved.



    Definitely agree that a big thank you must go to Kafkaesqui 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Displaying Posts inside Pages, almost going fine… HELP!!!’ is closed to new replies.