WordPress comment cookies not being set

For quite some time I thought WordPress wasn’t setting the comment cookies properly, because when I made comments the fields wouldn’t remain populated after I commented. I finally realized that if you’re logged in, you don’t have to worry about the fields at all because it pulls the name, e-mail address and URL from the user profile. This wasn’t very intuitive and the values still could have been filled in to the fields, but I realized that my theme just needed to exclude the name, e-mail and URL field if the user was logged in.

I believe there are lots of themes out there that would benefit from this change.

To update a theme, just use the conditional provided at the bottom of the get_currentuserinfo() page on the WordPress Codex.

Here’s what I added to my theme.

<?php if ('' == $user_ID) { ?>

. . . (The Name, E-mail and URL fields)

<?php } ?>






Number of readers
- home
comics
news links
other links

about me
blog archives
docs
entertainment
experiences
funny lists
humor
intellectual
interests
metafilter
music
opinions
photos
web designs
tools
software
webmaster help

Sign up
Enter your email address to be notified of new posts



Search blog archives

Calendar
February 2007
S M T W T F S
« Jan   Mar »
 123
45678910
11121314151617
18192021222324
25262728  







Random quote
(View all quotes)
"To cease smoking is the easiest thing I ever did; I ought to know because I have done it a thousand times. -- Mark Twain"










(?) Choose theme:  X X X X X X