• Hi,

    I’ve just upgraded from 2.9.2 to 3.0 and my site has died. I’ve written my own custom templates and it seems that everywhere I’m calling the_content() function inside a loop I am no longer getting anything returned. Aside from this the rest of the site is working correctly.

    I’m using the magic fields plug-in to manage custom fields. All of the content in the fields is populating correctly it’s just the main page content.

    I’m using about 10-odd plug-ins (half of which are on the admin side) so it could be one of these causing problems but I’m not using anything outlandish. Magic Fields is the only one I can think of that could conceivable cause this.

    I’ve backed up my db but if I can avoid doing a roll back that would be ideal.

    Anyone have any ideas?

    Thanks very much in advance,

    Olly

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter OLennox

    (@olennox)

    Update:

    This problem only seems to be affecting pages; posts (i.e. news articles on my site) are displaying correctly

    Thread Starter OLennox

    (@olennox)

    Have found the solution. For some reason I now need to call the_post(); before calling the_content();

    Could someone in the know tell me why this is?

    Cheers,

    I’m having a similar problem.. but on my site pages works well instead of posts..

    when I click posts, it does not show the content, but it display single post in “archive template” including only clicked post..

    I mean the url is, site.com/clicked-post-url

    then it shows clicked post in “archive template” but not the content of it..

    I’m also looking for a solution..

    Thread Starter OLennox

    (@olennox)

    I think yours sounds slightly different, if it’s using the wrong template then something is more fundamentally wrong. This problem is purely concerned with the_content() function in relation to page templates.

    I think that the error is on my part; In my page templates I am not using ‘the loop’. The reason being that page templates have always worked fine without it and surely when it comes to pages there is nothing to loop.

    Putting ‘the loop’ into my page templates did fix the problem but it caused other sections to break (namely where I perform sub-queries). The solution has been to keep my page templates as they were but call the_post() prior to calling the_content().

    Strangely, calls to other functions such as the_title() were still working correctly with or without the_post().

    I’d still be very interested to know why this problem has appeared since upgrading to 3.0 and the correct way to call the_content() in page templates.

    Cheers,

    I had to add the_post() to everything, from the blog section to my portfolio section and even my front page (which is a Page). It all works now but I find it really odd that I had to do it in the first place (that is, after I upgraded to WP3)

    I think the reason for this is you should just have one loop.php that you handle your content in. You call the_post() once in that file and badda bing. Dissect the 2010 theme to see this in action.

    I’m having the same problem. i tried called the_post but it screws things up worse. Where am I supposed to place it?

    Never mind, seems that the Bookmarkify plug-in has a conflict.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Help! the_content() not working post 3.0 upgrade’ is closed to new replies.