Tuesday - February 06, 2007
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 } ?>






# of readers
- home
meta
comics
news links
other links

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

Sign up
Enter your e-mail 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)
"Being a husband is like any other job. It helps a lot if you like the boss."










Licensed under Creative Commons
(?) Choose theme:  X X X X X X


W3CCSS
Loaded in 0.1261 seconds