WordPress.org

Ready to get started?Download WordPress

Forums

How to add comments box to a page? (12 posts)

  1. elanzap
    Member
    Posted 1 year ago #

    Hello,

    In my site I have comment box only on the home page and all the posts on home page. I am trying to add comment box to all other pages, but, I couldn't able to figure how to do it. Can some please help me with this?

    Here is my blog http://www.cricfree.info

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    please contact woothemes for support.

    generally, page.php of a theme would use some code like <?php comments_template(); ?> within the loop, to show the comments box;

    have you checked that comments are enabled for the individual static pages?

    dashboard - pages - all pages - quickedit below each page title - tick 'allow comments'

  3. elanzap
    Member
    Posted 1 year ago #

    Thank you alchymyth for trying to help me. I did check allow comments to all the pages, but, it didn't work. I am posting my theme-comments.php code here. If you can figure out something, please let me know.

    <?php
    // Fist full of comments
    function custom_comment($comment, $args, $depth) {
    $GLOBALS['comment'] = $comment; ?>

    <li class="comment wrap" id="comment-<?php comment_ID() ?>">

    <div class="col-left">
    <div class="inside">
    <?php if ($args['avatar_size'] != 0) echo get_avatar( $comment, $args['avatar_size'] ); ?>
    <p><?php comment_author_link() ?>
    </p>
    <p><small><?php comment_date('d. M, Y'); ?></small></p>
    </div>
    </div>
    <div class="col-right">
    <?php comment_text() ?>
    <?php if ($comment->comment_approved == '0') : ?>
    <p>Your comment is awaiting moderation.</p>
    <?php endif; ?>
    </div>

    <?php echo comment_reply_link(array('before' => '<span class="reply">', 'after' => '</span>', 'reply_text' => 'Reply to this comment', 'depth' => $depth, 'max_depth' => $args['max_depth'] )); ?>

    <div class="fix"></div>

    <?php
    }

    // PINGBACK / TRACKBACK OUTPUT
    function list_pings($comment, $args, $depth) {

    $GLOBALS['comment'] = $comment; ?>

    <li id="comment-<?php comment_ID(); ?>">
    <span class="author"><?php comment_author_link(); ?></span> -
    <span class="date"><?php echo get_comment_date(get_option('date_format')) ?></span>
    <span class="pingcontent"><?php comment_text() ?></span>

    <?php
    }

    function the_commenter_link() {
    $commenter = get_comment_author_link();
    if ( ereg( ']* class=[^>]+>', $commenter ) ) {$commenter = ereg_replace( '(]* class=[\'"]?)', '\\1url ' , $commenter );
    } else { $commenter = ereg_replace( '(<a )/', '\\1class="url "' , $commenter );}
    echo $commenter ;
    }

    function the_commenter_avatar() {
    $email = get_comment_author_email();
    $avatar = str_replace( "class='avatar", "class='photo avatar", get_avatar( "$email", "32" ) );
    echo $avatar;
    }

    ?>

  4. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    your posted code is only part of what is needed; does page.php have the 'comments_template()' code? does the theme have a comments.php?

    please contact woothemes for support; support is part of what you pay for when you buy a theme.

    this forum does not and cannot support commercial themes.

  5. elanzap
    Member
    Posted 1 year ago #

    Thanks again. My theme doesn't have "comments.php". It only has "theme-comments.php" that I posted above. Maybe I should contact woo themes.

  6. elanzap
    Member
    Posted 1 year ago #

    I guess you are talking about this code. What changes do I have to do here?

    <?php get_header(); ?>
    
    	<!-- Middle Starts -->
    	<div id="middle-out-top">
    	<div id="middle-out-bottom">
    	<div id="middle-content" <?php if ( comments_open() ) : ?>class="single"<?php endif; ?>>
    	<div id="middle-content-bottom">
    		<!-- Content Starts -->
    		<div id="content" class="wrap">
    			<div class="col-left">
    				<div id="main-content">
    
    				<?php if (have_posts()) : ?>
    				<?php while (have_posts()) : the_post(); ?>
    
    				<!-- Sing Post Starts -->
    					<div class="page post wrap">
    
    						<h1 class="title"><?php the_title(); ?></h1>
    
    						<?php the_content(); ?>
    						<?php edit_post_link('Edit Page', '', ''); ?>
    
    					</div>
    						<!-- Sing Post Ends -->
    
    				</div>
    
    				<?php endwhile; ?>
    
    				<div id="comments">
    
    					<?php //comments_template(); ?>
    
    				</div>
    
    				<?php endif; ?>
    
    			</div>
    
    			<div class="col-right">
    				<?php get_sidebar(); ?>
    			</div>
    		</div>
    		<!-- Content Ends -->
    	</div>
    	</div>
    	</div>
    	</div>
    	<!-- Middle Ends -->
    	<?php get_footer(); ?>

    [please mark any posted code - http://codex.wordpress.org/Forum_Welcome#Posting_Code ]

  7. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    somebody possibly edited this line in the past to hide comments:

    <?php //comments_template(); ?>

    now, change it to:

    <?php comments_template(); ?>
  8. elanzap
    Member
    Posted 1 year ago #

    Awesome...worked like charm. Thank you very much alchymyth. If I can rate you, I will give you five stars.

  9. harshkumar
    Member
    Posted 9 months ago #

    i want to add facebook coment box.how can i add coment script to coment after post or pages?

  10. rocketsingh
    Member
    Posted 8 months ago #

    hello i have comments.php in my theme but still comments are not showing in the posts please help me

  11. Alfsygr123
    Member
    Posted 7 months ago #

    https://developers.facebook.com/docs/plugins/comments#settings

    Read this. You can just copy-paste the plug-in code in your HTML and style it the way you like.

  12. Alfsygr123
    Member
    Posted 7 months ago #

    Have you added:

    <?php
    echo "<h2>Comment Input:</h2>";
    echo $name;
    echo "";
    echo $email;
    echo "";
    echo $website;
    echo "";
    echo $comment;
    echo "";
    echo $gender;
    ?>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

    at the end? I don't know what your code looks like, so...

Topic Closed

This topic has been closed to new replies.

About this Topic