I spent two or three hours this morning turning my comments into pop-ups. This is not the first time I have tried. It is the first time that I have succeeded.
I had been meaning to do this for some time but the last few times I tried it simply didn’t work. I gave up because I had better things to do, and put it on the back burner. It finally cooked, because last night I woke up and decided that the comments were astoundingly ugly the way they were, and they had to be a priority in making the next version of the site.
This morning they still didn’t work. Nor did they work when I followed the step-by-step instructions to set them up in the classic and default themes. I hunted around and eventally found answer to the problem in the WordPress forums.
The problem, simply put, is a difference between the conceptual thinking of the WordPress development team and me. They think of a blog as an endless roll of entries, and I think of this site has having a range of discrete separate entries. From their perspective comments will not normally appear on a page showing the details of a single entry. From my perspective that is the only place they should appear.
The answer turned out to be a single line of code that would have taken months to figure out on my own. Here it is:
<?php is_single = false; ?>
You add this before the comments pop up link on whatever single.php template you are using. Why? Because the script that tests to see if it should display pop-up comments checks to see if the page is a single page or not. So after you have established that it is a single page, in order to load in the right templates, you then switch the variable to fool the comments script.
The result is that the comments pop up. The comment from me is: sheesh!
Window size
I also wanted to change the size of the window. I discovered that you can do it like this:
<?php comments_popup_script(400, 500); ?>
This goes in the header.php file. The first number represents the width of the window, and the second is the height.