WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] problem with comments and navigation link

[Resolved] problem with comments and navigation link

  • I am new to making my own theme. I am having problem when I go into a single post. I can make it either have the comment box appear or the post navigation bar appear. Is there a solution for them to both appear?

    The following is my single.php. Thank you very much for your help.

    <?php get_header(); ?>
    <?php
    $myqueryname = $wp_query;
    $wp_query = null;
    $wp_query = new WP_Query();
    $wp_query->query(‘showposts=1′.’&paged=’.$paged);
    ?>

    <div id=”content”>

    <?php if (have_posts()) : ?>

    <?php while (have_posts()) : the_post(); ?>

    <div class=”post”>
    <div class=”post-date”><span class=”post-month”><?php the_time(‘M’) ?></span> <span class=”post-day”><?php the_time(‘j’) ?></span></div>
    <div class=”post-title”>
    <h2><?php the_title(); ?></h2>
    <span class=”post-cat”><?php the_category(‘, ‘) ?></span>
    <span class=”post-comments”><?php comments_popup_link(‘No Comments’, ‘1 Comment’, ‘% Comments’); ?></span>
    </div>
    <div class=”entry”>
    <?php the_content(‘Read the rest of this entry »’); ?>

    <?php wp_link_pages(array(‘before’ => ‘<p>Pages: ‘, ‘after’ => ‘</p>’, ‘next_or_number’ => ‘number’)); ?>
    </div>
    </div>

    <?php endwhile; ?>
    <?php wp_reset_query(); ?>
    <?php comments_template(); ?>

    <?php else : ?>

    <h2>Not Found</h2>
    <p>Sorry, but you are looking for something that isn’t here.</p>

    <?php endif; ?>
    <div class=”navigation”>
    <span class=”previous-entries”><?php next_posts_link(‘Older Entries’) ?></span>
    <span class=”next-entries”><?php previous_posts_link(‘Newer Entries’) ?></span>
    </div>

    <?php $wp_query = null; $wp_query = $myqueryname;?>

    </div>
    <!–/content –>

    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] problem with comments and navigation link’ is closed to new replies.