• Hi,

    When I click on a category link, instead of getting the most recent posts generated in that category, I would rather be brought to THE most recent post (and that is all).

    I can do this by limiting the loop to only displaying the FIRST post, but what I would rather do, is have some kind of fowarding mechanism that when category-1 is called, it will instead bring me to the single of the latest post in that category (so I can use the next_post and previous_post links).

    Any ideas ?

Viewing 5 replies - 1 through 5 (of 5 total)
  • I haven’t a clue how to get exactly where you’re headed, but I have a thought.

    Start with this plugin: http://mattread.com/projects/wp-plugins/custom-query-string-plugin/

    It will let you set your assorted category queries to 1 without changing how other parts of your blog are listed. Perhaps then you could just customize your category.php to have the next / prev links and display full post.

    Thread Starter thornomad

    (@thornomad)

    I will check it out: what I would like to be able to do is just use:

    <?php query_posts('cat=1&showposts=1');
    while (have_posts()) : the_post(); ?>
    <li><a href="<?php the_permalink() ?>" rel="bookmark" title="">What's New</a></li>
    <?php endwhile; ?>

    This accomplishes what I want, however, it messes up my loop and I don’t know how to reset the loop to work right.

    D

    While template file’s loop is that you’re editing?

    I was just working on this.

    I think this code may help you:


    <? // the first loop ?>
    <?php if (have_posts()) : ?>
    <?php query_posts('cat=4&amp;showposts=1');
    while (have_posts()) : the_post(); ?>

    <div class=&quot;post&quot; id=&quot;post-<?php the_ID(); ?>&quot;>
    <h2><a href=&quot;<?php the_permalink() ?>&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to <?php the_title(); ?>&quot;><?php the_title(); ?></a></h2>

    <div class=&quot;entry&quot;>
    <?php the_excerpt('Read More &amp;raquo;'); ?>
    </div>
    </div>

    <?php endwhile; ?>
    <? // End the first loop ?>

    <? // The second loop ?>

    <?php rewind_posts(); ?>

    <?php query_posts('cat=1&amp;showposts=1');
    while (have_posts()) : the_post(); ?>

    <div class=&quot;post&quot; id=&quot;post-<?php the_ID(); ?>&quot;>
    <h2><a href=&quot;<?php the_permalink() ?>&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to <?php the_title(); ?>&quot;><?php the_title(); ?></a></h2>

    <div class=&quot;entry&quot;>
    <?php the_excerpt('Read More &amp;raquo;'); ?>
    </div>
    </div>

    <?php endwhile; ?>

    <? // End the second loop ?>

    Hope this helps.

    Well… that didn’t decode so well did it?

    the &quot; are supposed to be quotations

    Hopefully you can work it out.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘DIsplay Single at Category ?’ is closed to new replies.