tags:

views:

23

answers:

2

I've seen this on a few sites now and its puzzling me. The page will be listed under the "Edit Posts" listing, however, when I click on "View Page" to see the live post, its being served out as a "Page". I can tell this by viewing the source and the body tag is...

<body class="page page-id-37 logged-in"> 

If its were actually a post, the body tag should be

<body class="single postid-63 logged-in"> 

I've seen a "post to page" and a "page to post" plugin that will convert between pages and posts, however, this site has NO plugins other than the wordpress defaults (akismet and hello dolly).

I'm stumped.

A: 

your may read this on body class functon, this function usually used by theme developer. It directly output class according to theme developer input. It seem the theme developer only use one file (page.php) to show page and post. (and it's better approach to create single.php to show a post).

So, the output will be like you describe.

justjoe
+1  A: 

Well I found the answer with a little more digging. Here's what's happened:

The site owner had originally created this post as a "Page". He then deleted this "page" and re-created it as a "post" with the same post slug as the one he had deleted.

As long as the deleted page had the same post slug as the new "post", Wordpress was presenting the content in the "page.php" template and not the single.php template.

The only way I could get it to work was to go to the Page's Trash listing and click "delete permanently" on the original page.

Scott B
wow, i never experience this. Thanks for sharing. But is it true that the new post can have same slug with a page in trash ? hmm i believe wp should fix this.
justjoe
It is absolutely true as of 2.9.2
Scott B