Converting WordPress Posts to Pages & Allowing Comments
By Raymond FongThis was neat, I spent a couple of hours last night scourging the web to figure out how to convert some WordPress posts into pages (on SEO Networker).
The first obvious solution was to simply copy and paste. This isn’t the most elegant solution but it got the job done (I tested it out on one of my posts). Of course, that has its handicaps in that I had to rename the page a different URL so that I can delete the old post (thereby freeing the OLD URL) before changing the page BACK into the old URL.
Confusing eh? Yes. And a pain in the butt!!!
But more importantly, a conundrum came up… What about all the comments associated with each of the posts? How do I port those over?
That opened a new can of worms, comments aren’t working on pages! How do I enable comments on pages? On the surface it looks like WordPress made this a snap by making it a simple option when you edit your pages (see below).
But alas, that didn’t do it! What to do what to do?
After doing some extensive research, I came across a thread on WordPress.org that showed me how to do it. You have to actually edit a bit of code in WordPress to make this happen:
You need to edit the page.php file for your theme and insert the following: <?php comments_template(); >
In the default theme it slips in best just before the close of the <div id=”content” class=”narrowcolumn”> tag on line 17 (I’m looking at theme version 1.6).
That’s all there is to it. You might also want to edit the comments.php file of same theme and add <?php if (!is_page()) { > before the line that reads <!– If comments are closed. –> and <?php } > after it. (It’s around line 57/58, again in default theme version 1.6.) This’ll stop the “Comments are closed” message from appearing on pages which to me doesn’t quite fit given the context.
Voila! That worked – yaye!
So I can have comments on the WordPress pages, but that still bags the question of how to transfer the comments from the post to the page. I refused to accept the brute force method (copy and paste) so I did a bit more digging.
The solution I found was in a neat little plugin called p2ponverter. With literally the push of a button, it converts your posts into pages (or vice versa).
And the best part is, it keeps all of your comments! How cool is that?
So there ya have it, converting posts to pages (while keeping all of the associated comments) and enabling comments on WordPress pages. All in a good night’s work
If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!
Related posts:
- can’t decide on the what widget… can’t decide on the what widget to use for the...










NEWS FEED





http://www.raymondfong.net – cool sitename man)))
Hello, I can’t understand how to add your blog ( http://www.raymondfong.net ) in my rss reader