Jump to content

Parse error: syntax error, unexpected ')', expecting '&' or T_VARIABLE in


ballhogjoni

Recommended Posts

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?

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.