Title: comments popup script
Last modified: August 19, 2016

---

# comments popup script

 *  [esco4466](https://wordpress.org/support/users/esco4466/)
 * (@esco4466)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/comments-popup-script/)
 * I am using comments-popup.php I have had people visit my blog saying that they
   have commented and the comments don’t show up. Sometimes they do sometimes they
   dont.
 * here is the comments -popup php
 *     ```
       <?php
       /**
        * @package WordPress
        * @subpackage Classic_Theme
        */
       ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
       <html xmlns="http://www.w3.org/1999/xhtml">
       <head>
            <title><?php echo get_option('blogname'); ?> - <?php echo sprintf(__("Comments on %s"), the_title('','',false)); ?></title>
   
       	<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
       	<style type="text/css" media="screen">
       		@import url( <?php bloginfo('stylesheet_url'); ?> );
       		body { margin: 5px; background: #E0DDD4; }
       	</style>
   
       </head>
       <body id="commentspopup">
   
       <?php
       /* Don't remove these lines. */
       add_filter('comment_text', 'popuplinks');
       if ( have_posts() ) :
       while( have_posts()) : the_post();
       ?>
   
       <?php if ('open' == $post->ping_status)  ?>
   
       <center>
       <div id="header-popup">
   
       </div>
       </center>
   
       <?php
       // this line is WordPress' motor, do not delete it.
       $commenter = wp_get_current_commenter();
       extract($commenter);
       $comments = get_approved_comments($id);
       $commentstatus = get_post($id);
       if ( post_password_required($commentstatus) ) {  // and it doesn't match the cookie
       	echo(get_the_password_form());
       } else { ?>
   
       <?php if ($comments) { ?>
   
       <?php } else { // this is displayed if there are no comments so far ?>
       	<p>No comments yet.</p>
       <?php } ?>
   
       <?php if ('open' == $post->comment_status) { ?>
       <div class="popup-formleft">
   
       <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
       <?php if ( $user_ID ) : ?>
       <p><?php printf(__('Logged in as %s.'), '<a href="'.get_option('siteurl').'/wp-admin/profile.php">'.$user_identity.'</a>'); ?> <a href="<?php echo wp_logout_url(); ?>" title="<?php echo attribute_escape(__('Log out of this account')); ?>"><?php _e('Log out &raquo;'); ?></a></p>
   
       <?php else : ?>
   
       	 <label for="author"><?php _e("{name}"); ?></label><br />
   
       	  <input type="text" name="author" id="author" class="textarea" value="<?php echo $comment_author; ?>" size="28" tabindex="1" /><br />
   
                <label for="email"><?php _e("{email}"); ?></label><br />
   
       	  <input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="28" tabindex="2" /><br />
   
                <label for="url"><?php _e("<abbr title=\"Universal Resource Locator\">{url}</abbr>"); ?></label><br />
   
       	  <input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="28" tabindex="3" /><br />
   
                <p><a href="javascript:window.close()"><?php _e("{close window}"); ?></a></p>
   
       <?php endif; ?>
       </div>
       <div class="popup-formright">
       	<p>
       	  <label for="comment"><?php _e("{comments warm my heart}"); ?></label>
       	<br />
       	  <textarea name="comment" id="comment" cols="25" rows="6" tabindex="4"></textarea>
       	</p>
   
       	<p>
       	  <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
       	  <input type="hidden" name="redirect_to" value="<?php echo attribute_escape($_SERVER["REQUEST_URI"]); ?>" />
       	  <input name="submit" type="submit" tabindex="5" value="<?php _e("{submit}"); ?>" onclick="self.close()" />
       	</p>
       	<?php do_action('comment_form', $post->ID); ?>
   
       </form>
       <?php } else { // comments are closed ?>
       <p><?php _e("Sorry, the comment form is closed at this time."); ?></p>
       <?php }
       } // end password check
       ?>
   
       </div>
   
       <?php // if you delete this the sky will fall on your head
       endwhile; //endwhile have_posts()
       else: //have_posts()
       ?>
       <p>Sorry, no posts matched your criteria.</p>
       <?php endif; ?>
   
       <!-- // this is just the end of the motor - don't touch that line either :) -->
       <?php //} ?>
   
       <?php // Seen at http://www.mijnkopthee.nl/log2/archive/2003/05/28/esc(18) ?>
       <script type="text/javascript">
       <!--
       document.onkeypress = function esc(e) {
       	if(typeof(e) == "undefined") { e=event; }
       	if (e.keyCode == 27) { self.close(); }
       }
       // -->
       </script>
       </body>
       </html>
       ```
   
 * I would love for them to work and also for them to automatically (ajax style,
   javascript, whatever) show up in the comments box.
 * any ideas? thanks so much

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter [esco4466](https://wordpress.org/support/users/esco4466/)
 * (@esco4466)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/comments-popup-script/#post-1121082)
 * here’s the website [http://heatheressianportraitarts.com](http://heatheressianportraitarts.com)
 *  Thread Starter [esco4466](https://wordpress.org/support/users/esco4466/)
 * (@esco4466)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/comments-popup-script/#post-1121341)
 * bump
 *  [shane-g](https://wordpress.org/support/users/shane-g/)
 * (@shane-g)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/comments-popup-script/#post-1121343)
 * Hi,
 * Refer these:
 * [http://codex.wordpress.org/Template_Tags/comments_popup_link](http://codex.wordpress.org/Template_Tags/comments_popup_link)
 * [http://codex.wordpress.org/FAQ_Using_WordPress#Can_I_have_popup_comments.3F](http://codex.wordpress.org/FAQ_Using_WordPress#Can_I_have_popup_comments.3F)
 * Thanks,
 * Shane G.
 *  Thread Starter [esco4466](https://wordpress.org/support/users/esco4466/)
 * (@esco4466)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/comments-popup-script/#post-1121355)
 * thanks for responding shane. however, those articles dont seem to address my 
   problem, do you have any idea why it would work sometimes and not others? maybe
   a browser issue?
 *  Thread Starter [esco4466](https://wordpress.org/support/users/esco4466/)
 * (@esco4466)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/comments-popup-script/#post-1121406)
 * help?!
 *  [joalbright](https://wordpress.org/support/users/joalbright/)
 * (@joalbright)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/comments-popup-script/#post-1121494)
 * you have
 * `onclick="self.close()"`
 * which will sometimes not load the submission before the window closes… which 
   is why some submissions go through and others don’t
 * i have yet to find a correct way to close it after form has finished submitting.
 * you could try setTImeout in a javascript function that closes the window and 
   is called by onClick.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘comments popup script’ is closed to new replies.

## Tags

 * [Comments](https://wordpress.org/support/topic-tag/comments/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 3 participants
 * Last reply from: [joalbright](https://wordpress.org/support/users/joalbright/)
 * Last activity: [16 years, 9 months ago](https://wordpress.org/support/topic/comments-popup-script/#post-1121494)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
