Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 5th Apr 2010, 11:53 PM   #1
BACKLINK MOGUL
War Room Member
 
howudoin's Avatar
 
Join Date: 2008
Location: Warrior Forum
Posts: 743
Thanks: 40
Thanked 67 Times in 37 Posts
Arrow
Getting Syntax Error In this Code of 18 Lines (php)
Share on: 
fb share twitter share gplus share more share

Here's the code:

------------------------------------------
<?php if (is_category()) {
$this_category = get_category($cat);
if (get_category_children($this_category->cat_ID) != "") {
echo "<ul>";
wp_list_categories('orderby=id&depth=1&show_count= 0&title_li=
&use_desc_for_title=1&child_of='.$this_category->cat_ID);
echo "</ul>";
}
}

else { ?>
<ul>
<?php $recent = new WP_Query("cat=1&showposts=3"); while($recent->have_posts()) : $recent->the_post();?>
<li><a href="<?php the_permalink();?>"><?php the_title(); ?></a></li>

</ul>
<?php
} ?>
------------------------------------------

I'm unable to find as to where exactly is the error?:rolleyes:

Can anybody help?

Thanks in advance
Bhupinder
howudoin is offline  
Unread 5th Apr 2010, 11:58 PM   #2
Advanced Warrior
War Room Member
 
Shounak Gupte's Avatar
 
Join Date: 2010
Location: Melbourne, Australia
Posts: 688
Thanks: 367
Thanked 70 Times in 58 Posts
Default
Re: Getting Syntax Error In this Code of 18 Lines (php)
Share on: 
fb share twitter share gplus share more share

what is the exact error you are getting?
Shounak Gupte is offline  
Unread 6th Apr 2010, 12:09 AM   #3
HyperActive Warrior
War Room Member
 
Join Date: 2009
Location: Costa Rica
Posts: 164
Thanks: 63
Thanked 44 Times in 41 Posts
Default
Re: Getting Syntax Error In this Code of 18 Lines (php)
Share on: 
fb share twitter share gplus share more share

you have (2) php declarations:

Code:
<?php
remove the one on line 18

I MARKET STUFF

imarketstuff is offline  
Unread 6th Apr 2010, 12:29 AM   #4
BACKLINK MOGUL
War Room Member
 
howudoin's Avatar
 
Join Date: 2008
Location: Warrior Forum
Posts: 743
Thanks: 40
Thanked 67 Times in 37 Posts
Arrow
Re: Getting Syntax Error In this Code of 18 Lines (php)
Share on: 
fb share twitter share gplus share more share

Originally Posted by imarketstuff View Post

you have (2) php declarations:

Code:
<?php
remove the one on line 18
Thanks for the answer but I'm unable to guess what You're pointing at!

Can you please type the complete code (With correction), so that I may get a better handle.

Thanks
Bhupinder
howudoin is offline  
Unread 6th Apr 2010, 12:45 AM   #5
BACKLINK MOGUL
War Room Member
 
howudoin's Avatar
 
Join Date: 2008
Location: Warrior Forum
Posts: 743
Thanks: 40
Thanked 67 Times in 37 Posts
Default
Re: Getting Syntax Error In this Code of 18 Lines (php)
Share on: 
fb share twitter share gplus share more share

what is the exact error you are getting?
I get the following Error:

Parse error: parse error, unexpected '}' in 2.php on line 18
howudoin is offline  
Unread 6th Apr 2010, 01:16 AM   #6
HyperActive Warrior
War Room Member
 
Join Date: 2009
Location: U.K
Posts: 197
Thanks: 5
Thanked 39 Times in 36 Posts
Default
Re: Getting Syntax Error In this Code of 18 Lines (php)
Share on: 
fb share twitter share gplus share more share

Bhupinder,

You arent ending your while loop.

<ul>
<?php $recent = new WP_Query("cat=1&showposts=3"); while($recent->have_posts()) : $recent->the_post();?>
<li><a href="<?php the_permalink();?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>
Luke Graham is offline  
Unread 6th Apr 2010, 01:19 AM   #7
Advanced Warrior
War Room Member
 
Shounak Gupte's Avatar
 
Join Date: 2010
Location: Melbourne, Australia
Posts: 688
Thanks: 367
Thanked 70 Times in 58 Posts
Default
Re: Getting Syntax Error In this Code of 18 Lines (php)
Share on: 
fb share twitter share gplus share more share

Originally Posted by Luke Graham View Post

Bhupinder,

You arent ending your while loop.

<ul>
<?php = new WP_Query("cat=1&showposts=3"); while(()) : ();?>
<li><a href="<?php the_permalink();?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>
this should fix it!
Shounak Gupte is offline  
Unread 6th Apr 2010, 09:22 AM   #8
HyperActive Warrior
War Room Member
 
Join Date: 2009
Location: Costa Rica
Posts: 164
Thanks: 63
Thanked 44 Times in 41 Posts
Default
Re: Getting Syntax Error In this Code of 18 Lines (php)
Share on: 
fb share twitter share gplus share more share

oh i was totally off-base with my answer, apologies!
my excuse, it was late in the night

I MARKET STUFF

imarketstuff is offline  
Closed Thread


Bookmarks

Tags
code, error, lines, php, syntax


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 02:26 AM.