Title: Issues with Metabox code
Last modified: February 28, 2020

---

# Issues with Metabox code

 *  Resolved [mobilemuseumofart](https://wordpress.org/support/users/mobilemuseumofart/)
 * (@mobilemuseumofart)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/issues-with-metabox-code/)
 * Hi! On my website yesterday, I noticed the following error code on my calendar
   page (located [here](https://www.mobilemuseumofart.com/calendar/)).
 * > **Warning**: count(): Parameter must be an array or an object that implements
   > Countable in **/home/XXXXXX/public_html/wp-content/themes/mmoart/wpalchemy/
   > MetaBox.php** on line **2126**
 * I logged into the code editor of my website and changed the code from this:
    `
   $cnt = count(!empty($this->meta[$n])?$this->meta[$n]:NULL);` to this: `$cnt =(!
   empty($this->meta[$n]))?count ($this->meta[$n]):0;`
 * Luckily, that took the error message off of my calendar page. However, I got 
   into work today, and I noticed that error message is now on every page that has
   a header. like the page [here](https://www.mobilemuseumofart.com/programs/).
 * I’m not sure what happened, but if there are any suggestions, I’d love to hear
   them.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [corrinarusso](https://wordpress.org/support/users/corrinarusso/)
 * (@corrinarusso)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/issues-with-metabox-code/#post-12492134)
 * [@mobilemuseumofart](https://wordpress.org/support/users/mobilemuseumofart/)
 * There is already a patch in place for this fix :
    [https://github.com/farinspace/wpalchemy/tree/master/wp-content/wpalchemy](https://github.com/farinspace/wpalchemy/tree/master/wp-content/wpalchemy)
 * Your theme probably updated and over-wrote your changes, unless you are in a 
   Child them.
 * You can also suppress your Warnings. Just add this to your config file :
    ini_set(‘
   display_errors’,’Off’); ini_set(‘error_reporting’, E_ALL ); define(‘WP_DEBUG’,
   false); define(‘WP_DEBUG_DISPLAY’, false);
 *  Thread Starter [mobilemuseumofart](https://wordpress.org/support/users/mobilemuseumofart/)
 * (@mobilemuseumofart)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/issues-with-metabox-code/#post-12492182)
 * I tried the patch for it, and I’m still getting the same error message.
 * I also tried suppressing the warnings, and that did not work either. I just got
   more error messages at the top of the page.
 *  [corrinarusso](https://wordpress.org/support/users/corrinarusso/)
 * (@corrinarusso)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/issues-with-metabox-code/#post-12492214)
 * [@mobilemuseumofart](https://wordpress.org/support/users/mobilemuseumofart/)
 * Did you add this as well :
    define(‘WP_DEBUG’, false);
 * Then this (fixed the quotes) :
    ini_set(‘display_errors’,’Off’); ini_set(‘error_reporting’,
   E_ALL ); define(‘WP_DEBUG’, false); define(‘WP_DEBUG_DISPLAY’, false);
 *  Thread Starter [mobilemuseumofart](https://wordpress.org/support/users/mobilemuseumofart/)
 * (@mobilemuseumofart)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/issues-with-metabox-code/#post-12492254)
 * Oh, man, I made the rookie mistake with the quotes. Went back in and fixed those,
   and now everything is working again. Thank you so much, [@corrinarusso](https://wordpress.org/support/users/corrinarusso/)!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Issues with Metabox code’ is closed to new replies.

## Tags

 * [array](https://wordpress.org/support/topic-tag/array/)
 * [count](https://wordpress.org/support/topic-tag/count/)
 * [countable](https://wordpress.org/support/topic-tag/countable/)
 * [metabox](https://wordpress.org/support/topic-tag/metabox/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [mobilemuseumofart](https://wordpress.org/support/users/mobilemuseumofart/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/issues-with-metabox-code/#post-12492254)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
