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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.