Viewing 15 replies - 1 through 15 (of 18 total)
  • not familiar with your theme
    if you have a category.php add this line just below the_content()

    <?php comments_template(); ?>

    if you don’t have a category.php, figure out which file is called for the category page

    Thread Starter goldmember

    (@goldmember)

    ok, it seems that the category pages are driven by archive.php. below is the archive.php code. i tried putting <?php comments_template(); ?> in different places throughout this page, but when i refresh, the comments box still does not appear.

    please advise. thanks.

    <?php get_header(); ?>
    <?php get_sidebar(); ?>
    
    <div id="content">
    <?php if (have_posts()) : ?>
    <?php $post = $posts[0]; ?>
    
    <?php if (is_category()) { ?><h2><?php echo single_cat_title(); ?></h2>
    <?php } elseif (is_day()) { ?><h2>Archive for <?php the_time('F jS, Y'); ?></h2>
    <?php } elseif (is_month()) { ?><h2>Archive for <?php the_time('F, Y'); ?></h2>
    <?php } elseif (is_year()) { ?><h2>Archive for the year <?php the_time('Y'); ?></h2>
    <?php } elseif (is_tag()) { ?><h2>Tag: <?php single_tag_title(''); ?></h2>
    <?php } elseif (is_search()) { ?><h2>Search results</h2>
    <?php } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?><h2>Archives</h2>
    <?php } ?>
    
    <?php while (have_posts()) : the_post(); ?>
    <h3><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
    <div class="contenttext">
    <?php the_content(''); ?>
    </div>
    
    <?php endwhile; ?>
    
    <div class="navigation">
    <p><span class="prevlink"><?php next_posts_link('&laquo; Previous entries') ?></span>
    <span class="nextlink"><?php previous_posts_link('Next entries &raquo;') ?></span></p>
    </div>
    
    <?php else : ?>
    <h2>Page not found!</h2>
    <p>The page you trying to reach does not exist, or has been moved. Please use the menus or the search box to find what you are looking for.</p>
    <?php endif; ?>
    
    </div>
    <?php get_footer(); ?>

    <?php comments_template(); ?>

    should most likely go right above <?php endwhile; ?>

    yes to what RVoodoo said
    clear browser cache, also, afterwards

    Thread Starter goldmember

    (@goldmember)

    thanks. tried it but no dice. please advise.

    where can I get your theme and test it on my local install?
    that’s just basic code stuff and should work

    Thread Starter goldmember

    (@goldmember)

    hmmm…well the archive.php doesn’t look at all like yours
    did you modify yours or maybe the theme has been updated

    the one I have already has a comment link after the post and yours doesn’t

    here is mine
    https://wordpress.pastebin.ca/1828894

    you might back up yours and replace it with mine and see how it works

    having said all that, you won’t be able to get the comment box, but you can get the comments link with above from the pastebin

    Thread Starter goldmember

    (@goldmember)

    i hacked up the theme pretty good at this point. it probably started out with the comment box there.

    so that stuff that’s in the pastebin is all the code i should try putting in my archive.php page?

    you can try it and see how it works
    back up your original 1st in case it clashes somehow

    Thread Starter goldmember

    (@goldmember)

    Thanks, that seems to be working…at least to get the Comments Link on there. I’m surprised there’s now way to put the comment box, if i can put the comment link.

    well you can edit the template to get rid of the comment link (line 25 of the pastebin file)

    and put in the <?php comments_template(); ?> stuff…..

    I didn’t look at the original code too in depth, you may have to fuss with some stuff to make it look right….

    Thread Starter goldmember

    (@goldmember)

    not sure i followed your instructions correclty, but i just removed:

    <p class="postinfo">
    <a href="<?php comments_link(); ?>"><strong>Comments:</strong> <?php comments_number('none','1','%'); ?></a></p>

    and replaced with:

    <p class="postinfo">
    <a href="<?php comments_template(); ?>"><strong>Comments:</strong> <?php comments_number('none','1','%'); ?></a></p>

    but the Comments Link is still there, and no Comments box (which is what i’d like. please advise.

    I think it would just be….

    <p class="postinfo">
    <?php comments_template(); ?></p>

    Maybe even that p class and </p> stuff could go. Again, not too familiar with the theme….

    Thread Starter goldmember

    (@goldmember)

    thanks but that didnt work. the comments section disappeared altogether when i tried it.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘add comment box to category page’ is closed to new replies.