How to add comments to Wordpress homepage
So, I use Wordpress. I don’t like Wordpress at all, but I used it at my last job so I got some experience with it and that means that it was easier to just use it and deal with the consequences later. I wouldn’t recommend it to another developer though, the codebase is truly hideous.
I recently wanted to add comments to my homepage. I only like to make changes to my template and not to change any Wordpress “core code”, since then I’ll have to make all those changes everytime I update Wordpress. I didn’t think this policy would be a problem for me this time since all I was trying to do was add the ‘comments template’ to the homepage and I thought that I should be able to just copy the appropriate line from my ’single.php’ into my ‘homepage.php’… Wrong! How any ‘non-technical’ person manages to use wordpress is beyond me…
Anyhow, I did some digging and found the problem. The function comments_template in comment-template.php has these lines:
return;
I’m not going to go into the reason why these lines are harmful but I’ll just say that my argument might be summed up as “hard coded configuration”. Anyway, these lines in homepage.php will get you what you want:
comments_template();
Or, if you want to be a smartass like myself, this will work too:
comments_template();
Cheers!
Tags: add comments, comments, how to, wordpress homepage
June 17th, 2009 at 4:19 pm
woops, happens onteh detail page as well. Something else is going on. I suspect soemthing about moving wp-content.