Forums

Comment Template on Author Page (4 posts)

  1. markzero
    Member
    Posted 1 year ago #

    Title says it all..

    Can we have comments template on other pages other than posts (single.php) and pages (page.php), like author (author.php)?

  2. valandil
    Member
    Posted 1 year ago #

    Yes you can just include it ;)

  3. markzero
    Member
    Posted 1 year ago #

    Ok here's my code:

    $args = array(
    	'posts_per_page' => 1,
    	'author_name' => $curauth->user_nicename
    );
    $temp = $wp_query;
    $wp_query = null;
    $wp_query = new WP_Query($args);
    ?>
    <?php
    if( have_posts() ) :
    while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
    <h4><?php the_title(); ?></h4>
    <?php the_content(); ?>
    <?php endwhile; ?>
    <?php comments_template(); ?>
    <?php endif; ?>

    And I'm not getting comment template. On single.php it does appear.
    Ideas?

  4. markzero
    Member
    Posted 1 year ago #

    Sorry for bumping, but I really need to know whether is it possible ??
    Anyone?

Topic Closed

This topic has been closed to new replies.

About this Topic