1

I am using a page.php template I have used on about 400 Wordpress websites, and all of a sudden the loop decides it doesn't want to display any content.

Code is:

<div class="text-content">
  <?php if (have_posts()) : while (have_posts()) : the_post();?>
    <h1><?php the_title(); ?></h1>
    <?php the_content(); ?>
  <?php endwhile; endif; ?>
</div>

Page title displays fine so loop is fine, content remains blank.

Any advice? Never seen this before. Thanks

7
  • 1
    Couple of initial thoughts: Might be a filter, the text might be there but not visible due to CSS, there may be no content saved, or it might be a genuine issue. Your question is not focused enough. What have you tried? What were the results?
    – mor7ifer
    Jan 28, 2015 at 23:34
  • I tried disabling the 2 activated plugins, no luck, viewed the source and there is definately no content so not CSS, tried removing the title so its just content, title disappeared but still no content, finally tried deleting the content, re-publishing the page, then re-pasting content in and re-publishing again, nothing! :-(
    – Adrian
    Jan 29, 2015 at 0:00
  • Could you post up your content? Or try extra simple content (like 'test content') and see if that shows up? That would rule out a problem with your content.
    – Privateer
    Jan 29, 2015 at 0:17
  • Just replaced all content with "test" and still nothing, this is on all pages that use the page.php template too. Full page.php content: pastebin.com/cbQsKdj6
    – Adrian
    Jan 29, 2015 at 0:27
  • Which theme? Post your functions.php on pastebin too.
    – Robert hue
    Jan 29, 2015 at 7:29

1 Answer 1

2

OK, sorted, re-uploaded my pre-developed functions.php file, in which I had only removed a function for breadcrumbs and one for pagination, but this must have some how affected page content, so anyway this is back, thanks for your time.

3
  • 1
    If this is the answer, mark it as the solution so that the question does not show up as unanswered.
    – mor7ifer
    Jan 29, 2015 at 14:25
  • It wont let me accept my own answer until tomorrow, is there a 24 hour restriction on this or something?
    – Adrian
    Jan 29, 2015 at 14:39
  • There may be. I don't ask much, I mainly answer.
    – mor7ifer
    Jan 29, 2015 at 14:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.