Implode Error in Theme...

I have installed a theme on my site…but it is showing error on main page…
may somebody help me…i shall be thank full for help…error message is given below…

Warning: implode() [function.implode]: Invalid arguments passed in /home/urcric/public_html/trendztime.com/wp-content/themes/ZPRESS/functions/wpzoom-widgets.php on line 1450

line 1450 is underlined…full code could not post here due to allowed limit…

if ($type == ‘tag’)
{
$postsq = $slugs;
}
elseif ($type == ‘cat’)
{
$postsq = implode(",",$category);
}

/* Before widget (defined by themes). */
//echo $before_widget;
?>

Well, $category MUST be an array. Did you create it as an array?

Also, if something INSIDE the array can not be converted correctly, it might throw that exception.
But, most likely, you did not define $category as an array!

i don’t know php…

Okay, you have over 1450 lines of code? And, you have a PHP error and do not know PHP?

Yikes, how can you code 1450+ lines of code without knowing what you are coding? LOL…

Okay, PHP’s IMPLODE is explained here. Note the posts down the page a little:
http://php.net/manual/en/function.implode.php

Basically, IMPLODE takes an array which has been created in previous code and combines it into one string using the first argument as a “delimiter”. So, if the array has (“This”, “is”, “sample”, “1”, “.”) in it, the output of implode using “,” as your code does, would be “This,is,sample,1,.”. So, the code you showed was okay. It was valid and correct. So, without seeing more of your code especially where the array was created, we have no way of fixing it for you. Hope that made sense… Look back in your code where the array “$category” was created. That is most likely the REAL error area… Good luck…

i used Notepad ++ to verify the exact lines…i am unable to post full code or attach note pad file…

Well, again, it must be the $category variable that is NOT defined as an array.

You can “ECHO” the $category to see what is in it. This would be a start.

Something like: echo $category; then, die(“end for now…”);

That will show what is in $category and then end the script. You will be able to see the data inside $category and perhaps figure out what is wrong. I am guessing that you need to use more error-checking code before trying to implode $category.

Good luck…

Sponsor our Newsletter | Privacy Policy | Terms of Service