Solved

How do I add comments on Wordpress?

Posted on 2009-07-14
18
525 Views
Last Modified: 2013-11-19
Hello all,

I uploaded a free Wordpress theme on my server.  I also have Askimet and Get Recent Comments.  But the problem is when I uploaded my first post, there is no option for anyone to comment.  What did I forget to do?

http://www.clearlydizzy.com/clearlydizzy/wordpress/?p=47

Thanks in advance :)
~Amy
0
Comment
Question by:privateland
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 7
18 Comments
 
LVL 30

Expert Comment

by:Britt Thompson
ID: 24853562
Your page isn't completely rendering out...it's halting on your sidebar again.

You need your feedback section included in your index.php within your theme:

<div class="feedback"><?php wp_link_pages(); ?><?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?></div>

this as well:

<div class="guests">
<?php comments_template(); // Get wp-comments.php template ?>
</div>
0
 

Author Comment

by:privateland
ID: 24853716
I still haven't worked on that part of it :(  I am not yet wanting it to hook up with Flickr so I'm needing to get rid of that.

Below I've included index.php.  I'm a little confused because I'm not sure where I should put it?

 
<?php get_header(); ?>
 
<div id="content">
 
	<div class="postgroup">
	
		<?php while (have_posts()) : the_post(); ?>
		<div class="post indexpost" id="post-<?php the_ID(); ?>">
			<?php
				$customfields = get_post_custom();
				$scrp = get_bloginfo('wpurl') . '/wp-content/themes/magasin-siete/images/Alan.jpg?';
				if (empty($customfields['paddimage'][0])) {
					$imgpath = $scrp . 'src=' . get_bloginfo('wpurl') . '/wp-content/themes/magasin-siete/images/thumbnail.png' . '&amp;w=132&amp;h=132&amp;zc=1';
				} else {
					$imgpath = $scrp;
				}
			?>
			<div class="title">
				<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
						<?php the_title(); ?></a>
                </h2>
                <div class="postdate">
                    <span class="postdate-month">
							<?php the_time('M '); ?> 
					</span>
                    <span class="postdate-day">
							<?php the_time('d '); ?> 
					</span>
				</div>
            
				
			</div>
 
			<div class="entry">
               <div class="belowtitles">
                
                <?php
					$posttags = get_the_tags();
					if ($posttags) {
						
						?>  <? the_tags('<span class="section-1">', '</span><span class="section-1">', '</span>'); ?> 
						<?
					} ?>
					<span class="nodisplay">|</span>
                    <span class="section-3"><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></span>
				</div>
				  <img class="header" src="<?php echo $imgpath; ?>" alt="<?php the_title(); ?>" />
				<div class="text">
 
					<?php themefunction_content(340,'');?>
				</div>
                <div class="clearer"></div>
			</div>
            
		</div>
			
		<?php endwhile; ?>
				
 
	</div><!-- Postgroup ends here-->
		<div id="pagenav">
			<?php 
				if (function_exists('wp_pagenavi')) : 
					wp_pagenavi();  
				else : 
			?>
			<div class="simplenavi">
				<?php posts_nav_link(' &nbsp;&nbsp;','&laquo; Previous Entries','Next Entries &raquo;') ?></div>
			</div>
			<?php
				endif;
			?>
		</div> <!-- Pagenav ends here-->
</div><!-- Content wrapper ends here-->
 
<?php get_sidebar(); ?>
<?php get_footer(); ?>

Open in new window

0
 

Author Comment

by:privateland
ID: 24853780
Okay, took out the Flickr :)

On the above code, should I take out Line 46 and add what you posted above?

Line 46:
<span class="section-3"><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></span>

Open in new window

0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 30

Expert Comment

by:Britt Thompson
ID: 24853821
try changing this:

<span class="section-3"><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></span>

to this:

<?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>

Also, here's my index.php for reference. You need to make sure that commenting is enabled. Typically, it will show that comments are disabled but I'm not sure with your template.
<?php
get_header();
?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="info">
<div class="date"><h5><?php the_time('l, F jS, Y'); ?></h5></div>
<div class="meta"><?php _e("Filed under: "); ?><?php the_category(',') ?>&nbsp;&#8212;&nbsp;<?php the_tags(__('Tags: '), ', ', ' &#8212; '); ?><br /><br />
Last update: <?php the_author() ?>&nbsp;@&nbsp;<?php the_time() ?><br /><br />
<?php edit_post_link(__('Edit This')); ?></div><br />
<div class="footnotes"><?php the_meta(); ?></div>
</div>
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<h3 class="storytitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
<div class="storycontent"><?php the_content(__('(more...)')); ?></div>
<div class="feedback"><?php wp_link_pages(); ?><?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?></div>
</div>
<div style="clear:both;"></div>
<div class="guests">
<?php comments_template(); // Get wp-comments.php template ?>
</div>
<?php endwhile; else: ?>
 
<p>
<?php _e('Sorry, no posts matched your criteria.'); ?>
</p>
<?php endif; ?>
<?php posts_nav_link(' &#8212; ', __('&laquo; Newer Posts'), __('Older Posts &raquo;')); ?>
<div style="clear:both;"></div>
<?php get_footer(); ?>

Open in new window

0
 

Author Comment

by:privateland
ID: 24853938
Hmmm...I'm still not getting it.  I added that in there, and actually there was a slight change on the page, showing "Comments (0)", but still no place to add comments.  I do have a comments.php...I posted it below.  Perhaps there is something there I should change?
<div id="comments">
<div class="top"></div>
<div class="mid">
<div class="title">
<h2>Comments</h2>
<p><?php comments_number('No Responses', 'One Response', '% Responses' );?> to &#8220;<?php the_title(); ?>&#8221;</p>
</div>
<div class="details">
<?php if ( have_comments() ) : ?>
<div class="navigation">
<div class="prev"><?php previous_comments_link() ?></div>
<div class="next"><?php next_comments_link() ?></div>
</div>
<ol class="commentlist">
<?php wp_list_comments('callback=themefunction_comments'); ?>
</ol>
<div class="navigation">
<div class="prev"><?php previous_comments_link() ?></div>
<div class="next"><?php next_comments_link() ?></div>
</div>
<?php endif; ?>
</div>
</div>
<div class="bot"></div>
</div>
 
<div id="respond">
<div class="top"></div>
<div class="mid">
<div class="title">
<h2>Write a Comment</h2>
</div>
		
<div class="details">
<?php if ('open' == $post->comment_status) : ?>
<div class="cancel-comment-reply">
<small><?php cancel_comment_reply_link(); ?></small>
</div>
<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
<p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p>
<?php else : ?>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<?php if ( $user_ID ) : ?>
<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account">Log out &raquo;</a></p>
<?php else : ?>
<p class="input">
<span><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> /></span>
<label for="author"><small>Name <?php if ($req) echo "(required)"; ?></small></label>
</p>
<p class="input">
<span><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> /></span>
<label for="email"><small>Mail (will not be published) <?php if ($req) echo "(required)"; ?></small></label>
</p>
<p class="input">
<span><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" /></span>
<label for="url"><small>Website</small></label>
</p>
<?php endif; ?>
<!--<p><small><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?></code></small></p>-->
<p class="textarea"><span><textarea name="comment" id="comment" cols="85%" rows="10" tabindex="4"></textarea></span></p>
<p>
<button name="submit" type="submit" id="submit" tabindex="5">Submit Comment</button>
<?php comment_id_fields(); ?>
</p>
<?php do_action('comment_form', $post->ID); ?>
</form>
<?php endif; // If registration required and not logged in ?>
<?php else : ?>
<p class="nocomments">Comments are closed.</p>
<?php endif; // if you delete this the sky will fall on your head ?>
</div>
</div>
<div class="bot"></div>
</div>

Open in new window

0
 
LVL 30

Expert Comment

by:Britt Thompson
ID: 24854037
This has to be included in your index.php :

<?php comments_template(); // Get wp-comments.php template ?>

0
 

Author Comment

by:privateland
ID: 24854086
Okay, the following is the index.php code revised.
<?php get_header(); ?>
 
<div id="content">
 
	<div class="postgroup">
	
		<?php while (have_posts()) : the_post(); ?>
		<div class="post indexpost" id="post-<?php the_ID(); ?>">
			<?php
				$customfields = get_post_custom();
				$scrp = get_bloginfo('wpurl') . '/wp-content/themes/magasin-siete/images/Alan.jpg?';
				if (empty($customfields['paddimage'][0])) {
					$imgpath = $scrp . 'src=' . get_bloginfo('wpurl') . '/wp-content/themes/magasin-siete/images/thumbnail.png' . '&amp;w=132&amp;h=132&amp;zc=1';
				} else {
					$imgpath = $scrp;
				}
			?>
			<div class="title">
				<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
						<?php the_title(); ?></a>
                </h2>
                <div class="postdate">
                    <span class="postdate-month">
							<?php the_time('M '); ?> 
					</span>
                    <span class="postdate-day">
							<?php the_time('d '); ?> 
					</span>
				</div>
            
				
			</div>
 
			<div class="entry">
               <div class="belowtitles">
                
                <?php
					$posttags = get_the_tags();
					if ($posttags) {
						
						?>  <? the_tags('<span class="section-1">', '</span><span class="section-1">', '</span>'); ?> 
						<?
					} ?>
					<span class="nodisplay">|</span>
                    <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
				</div><div style="clear:both;"></div>
<div class="guests">
<?php comments_template(); // Get wp-comments.php template ?>
</div>
 
				  <img class="header" src="<?php echo $imgpath; ?>" alt="<?php the_title(); ?>" />
				<div class="text">
 
					<?php themefunction_content(340,'');?>
				</div>
                <div class="clearer"></div>
			</div>
            
		</div>
			
		<?php endwhile; ?>
				
 
	</div><!-- Postgroup ends here-->
		<div id="pagenav">
			<?php 
				if (function_exists('wp_pagenavi')) : 
					wp_pagenavi();  
				else : 
			?>
			<div class="simplenavi">
				<?php posts_nav_link(' &nbsp;&nbsp;','&laquo; Previous Entries','Next Entries &raquo;') ?></div>
			</div>
			<?php
				endif;
			?>
		</div> <!-- Pagenav ends here-->
</div><!-- Content wrapper ends here-->
 
<?php get_sidebar(); ?>
<?php get_footer(); ?>

Open in new window

0
 
LVL 30

Expert Comment

by:Britt Thompson
ID: 24854128
that looks right...publish it and see what you get.
0
 

Author Comment

by:privateland
ID: 24854151
Hmmm...still no comments :(  Should I be adding something withing page.php maybe?
0
 
LVL 30

Expert Comment

by:Britt Thompson
ID: 24854206
put all this:

<?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
                        </div><div style="clear:both;"></div>
<div class="guests">
<?php comments_template(); // Get wp-comments.php template ?>
</div>

after this:

<div class="clearer"></div>


and see what happens.
0
 

Author Comment

by:privateland
ID: 24854242
All that did was take the "Comments(0)" from the above the article to below the article :(  Not sure what to do now.
0
 
LVL 30

Expert Comment

by:Britt Thompson
ID: 24854270
Maybe your template does actually require the page.php to contain the : <?php comments_template(); // Get wp-comments.php template ?>

give it a try...or post your page.php
0
 

Author Comment

by:privateland
ID: 24854316
Okay, I added that part to the page.php and this is what page.php now looks like...

<?php get_header(); ?>
 
<div id="content">
 
	<div class="postgroup">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
	<div class="post singlepost" id="post-<?php the_ID(); ?>">
		<div class="title">
			<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
			                <div class="postdate">
                    <span class="postdate-month">
							<?php the_time('M '); ?> 
					</span>
                    <span class="postdate-day">
							<?php the_time('d '); ?> 
					</span>
				</div>
			
		</div>
		<div class="entry">
        <?php
				$ad_468 = get_option('padd_ad_468');
				if (!empty($ad_468)) :
			?>
			<div class="singlegoogle">
				<?php echo stripslashes($ad_468); ?>
			</div>
			<?php endif; ?>
			<?php the_content('[More]'); ?>
			<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
		</div>
 
	</div>	
    <div class="clearer"></div>
<div class="guests">
<?php comments_template(); // Get wp-comments.php template ?>
</div>
<?php endwhile; else: ?>
 
    
    
    <div class="post singlepost">
		<div class="title">
			<h2>No Page Found</h2>
		</div>
		<div class="entry errorentry">
			<p>Sorry, but you are looking for a page that isn't here.</p>
		</div>
	</div>
<?php endif; ?>
	</div>
</div>
 
<?php get_sidebar(); ?>
<?php get_footer(); ?>

Open in new window

0
 

Author Comment

by:privateland
ID: 24855020
Hello?  That didn't make it work.  Hmmm...any ideas?
0
 
LVL 30

Accepted Solution

by:
Britt Thompson earned 500 total points
ID: 24891160
If you switch templates temporarily does the comment section appear?
0
 

Author Comment

by:privateland
ID: 25528708
I pretty much am going to have to just go with another layout.  Thanks for your help though :)
0

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question