ballhogjoni Posted October 6, 2010 Share Posted October 6, 2010 I am getting this error and cant figure it out: Parse error: syntax error, unexpected ')', expecting '&' or T_VARIABLE in /path/to/app/cool.php on line 150 this is line 50: function GetParentIDS(){ this is the rest of the function: global $wpdb; $CATS = ""; $Maincategories = get_categories('use_desc_for_title=1&hide_empty=0&hierarchical=0'); $Maincatcount = count($Maincategories); foreach ($Maincategories as $Maincat) { if($Maincat->parent ==0){ $CATS .= $Maincat->cat_ID.","; } } return $CATS; } this is the function above it: function sidebarArticles(){ global $wpdb; global $PPT; $string=""; $posts = query_posts('meta_key=type&meta_value=article&posts_per_page=5'); foreach($posts as $article){ $Artimage = get_post_meta($article->ID, 'image', true); $string .= "<li>"; if(strlen($Artimage) > 1){ $string .= '<a href="'.get_permalink($article->ID).'" title="'.$article->post_title.'"><img src="'.$PPT->ImageCheck($Artimage).'" style="float:right; max-width:40px; max-height:40px;" /></a>'; } $string .= "<h4><a href='".get_permalink($article)."'>".$article->post_title."</a></h4> <cite>Posted <em>".$PPT->TimeDiff($article->post_date)."</em></cite> <p>".$article->post_excerpt."</p> </li>"; } return $string; } Any ideas? Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted October 6, 2010 Share Posted October 6, 2010 The error says line 150, not line 50. Is that an oversight, or a typo? Quote Link to comment Share on other sites More sharing options...
ballhogjoni Posted October 6, 2010 Author Share Posted October 6, 2010 oops thats what i meant. Quote Link to comment Share on other sites More sharing options...
ballhogjoni Posted October 6, 2010 Author Share Posted October 6, 2010 ok figured it out...nothing wrong with the code that I posted in the first post. I was editing in the wordpress editor and had made a change that caused the error. I clicked the back button on the browser which showed the broken code, i changed it to worked right but since the file was saved with broken code wordpress couldn't update the correct changes. I just logged into the server and made the changes in vim and it fixed right up. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.