• melbell

    (@melbell)


    I have the following that I am using to show the post titles of one category in my sidebar:


    <?php $my_query = new WP_Query('category_name=Plugins&showposts=10'); ?>
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    <li><h2>Testing</h2>
    <ul>
    <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></li>
    </ul>
    <?php endwhile; ?>

    It works fine, in itself, but it causes my Previous and Next links on my archive pages to disappear. How can I fix this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Firas

    (@firas)

    If you just want titles/links, try http://codex.ww.wp.xz.cn/Template_Tags/get_posts

    Thread Starter melbell

    (@melbell)

    Ok, here’s what I did:


    <?php
    $posts = get_posts('numberposts=20&category=8');
    foreach ($posts as $post) : ?>
    <li><h2>Testing</h2>
    <ul>
    <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></li>
    </ul>
    <?php endforeach; ?>

    It seems to be working fine! Thanks! 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Second Query Breaks Nav Links’ is closed to new replies.