• Resolved mixel

    (@mixel)


    Hi.. On any of my pages that are “post” based and not “page” based I get the following error at the top of the page:

    Warning: count(): Parameter must be an array or an object that implements Countable in /home/myusername/public_html/myurl.com/wp-includes/post-template.php on line 284

    eg every single comic page other than the one on landing/homepage has that weird error. I’ve tried disabling every plugin and its definitely only appearing with Comic Easel enabled, and not when it’s disabled.

    Is there a way to make it go away? ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • I only had a brief glimpse at line 284 of WP’s post-template.php just now, but that count() function refers to the post’s page count, more precisely an array called $pages that your site seems to lose before that function is called. Any chance you edited or deleted anything to do with pagination settings?

    If not, from what I read this concerns all posts? Not just comic posts? It’s possible that this is a theme issue rather than a plugin issue, then. Remember doing anything that may affect pagination while setting that up?

    • This reply was modified 6 years, 5 months ago by MaxVaehling.
    Thread Starter mixel

    (@mixel)

    Thanks for the reply. ??

    I don’t think I’ve edited or deleted anything to do with pagination.. If I did it was years ago and I’ve forgotten in the interim. :/

    I just enabled the blog and it doesn’t happen there.. So it is just on comics pages. I’ve had the blog disabled for a few years so hadn’t realised.

    It does the same error when I’m using comicpress default and comicpress boxed themes. It’s an odd error because it doesn’t stop it from displaying the right pages etc. It’s not too bad because it doesn’t show it on the homepage, but it does as you go back/forward through the pages.

    Did you edit any of the Comic Easel files?

    If it’s just comics pages, it can either be something amiss in the comic Easel files or some misconfiguration introduced by something else concerning custom post types. To check if it’s CE, you could try and replace your CE files, one by one, with freshly downloaded factory-setting files. (After making the proper amount of backups, of course.) If it goes away, you found the right file! (single.php is always a good place to start unless it’s also the archive pages.)

    However, if you’re sure it isn’t doing any harm and you really just want the message to go away, there’s a quick fix:

    Download and open your wp-config file and change the following code:
    define('WP_DEBUG', true);
    to ‘false’.

    If that doesn’t do it, try replacing the line with:

    ini_set('display_errors','Off');
    ini_set('error_reporting', E_ALL );
    define('WP_DEBUG', false);
    define('WP_DEBUG_DISPLAY', false);

    (There’s a third option involving your .htaccess file, but these should do.)

    What this does is, it turns off all php error messages. You should do that anyway because hackers might exploit these messages by provoking errors to learn about your site’s vulnerabilities.

    • This reply was modified 6 years, 5 months ago by MaxVaehling.
    Thread Starter mixel

    (@mixel)

    I tried the individual file uploads but it didn’t change things. Pretty confusing really.

    That second fix in WP-config worked though. ?? Puzzling but at least it works.

    Thanks so much, that makes it look much less buggy.. The error didn’t seem to have any functional impact on the site anyway.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error at top of page’ is closed to new replies.