Title: please help with Warning: implode()
Last modified: August 19, 2016

---

# please help with Warning: implode()

 *  Resolved [kramz](https://wordpress.org/support/users/kramz/)
 * (@kramz)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/please-help-with-warning-implode/)
 * Under my theme options I made a checkbox list of all my categories so that users
   can check to exclude from the header menu. It seems to work. However, when I 
   don’t have any of them checked I get this warning on every page:
    Warning: implode()[
   function.implode]: Invalid arguments passed in /home/kramz/public_html/blog/wp-
   content/themes/blognfolio/header.php on line 38
 * Warning: implode() [function.implode]: Invalid arguments passed in /home/kramz/
   public_html/blog/wp-content/themes/blognfolio/header.php on line 43
    my code 
   on line 38 looks like this: `$exclude = implode (",".$bnf_exc_cat);`
 * line 43
    `$excludep = implode (",".$bnf_exc_pages);`
 * Any tips?

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

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/please-help-with-warning-implode/#post-1449561)
 * Well you need a comma, not a period, in that implode:
    `$exclude = implode (",",
   $bnf_exc_cat);`
 * so don’t know if you need this, but just in case:
 *     ```
       if ($bnf_exc_cat) {
       $exclude = implode (",",$bnf_exc_cat);
       }
       ```
   
 *  Thread Starter [kramz](https://wordpress.org/support/users/kramz/)
 * (@kramz)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/please-help-with-warning-implode/#post-1449591)
 * Hey MichaelH, thanks for your quick reply.
 * I don’t know why I posted it with a period, I do have it with a comma.
    It looks
   just like your example and the warning still shows up. I’ve been trying to find
   what seems to be the problem and it looks like it shows up only when the options
   are empty. Every time I check a category it gets excluded with no problem from
   the header. But, as soon as I uncheck them the warning shows up.
 * How can I fix this?
 *  Thread Starter [kramz](https://wordpress.org/support/users/kramz/)
 * (@kramz)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/please-help-with-warning-implode/#post-1449661)
 * Anyone?
 *  Thread Starter [kramz](https://wordpress.org/support/users/kramz/)
 * (@kramz)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/please-help-with-warning-implode/#post-1449675)
 * Finally solved it! in case you’re wondering this is what I did.
 *     ```
       $categorias = $bnf_exc_cat;
       	if ($categorias){
       		$categorias_exc= implode(",",$categorias);
       	} else {
       		$categorias_exc="";
       	}
       ```
   
 * I assume this was because it was attempting to implode ‘nothing’.

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

The topic ‘please help with Warning: implode()’ is closed to new replies.

## Tags

 * [implode](https://wordpress.org/support/topic-tag/implode/)
 * [warning](https://wordpress.org/support/topic-tag/warning/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [kramz](https://wordpress.org/support/users/kramz/)
 * Last activity: [16 years, 1 month ago](https://wordpress.org/support/topic/please-help-with-warning-implode/#post-1449675)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
