I am using HTML5 Blank to make my site. I wanted to style some pages differently than others, and therefore made a page template for them. In this page template I have used this to get the content:
<?php the_content(); ?>
This worked perfectly yesterday. Then I woke up today and now the same pages show this error and no content:
Warning: count(): Parameter must be an array or an object that implements Countable in /home/insitvbt/treningsglad/wp-includes/post-template.php on line 317
Everything else in the page template file loads fine, just not the content. I can't see anything in the logs about any updates happening from yesterday until today, so this perplexes me a bit.
These are the lines around 317 in post-template.php:
// If the requested page doesn't exist.
Line 317 ---> if ( $elements['page'] > count( $elements['pages'] ) ) {
// Give them the highest numbered page that DOES exist.
$elements['page'] = count( $elements['pages'] );
}
I have Googled for about an hour and find many people with the same type of problem, but no apparent solution to my exact case. I have disabled all plugins without that helping at all.
Normal posts and pages with the standard template load fine, just not pages with page templates that worked 24 hours ago with no changes up to this point in time.
Where would I begin to solve this?
the_content()
inside the loop? Might be just easier if you can share the full page template code.