[wp-hackers] get_posts problem...

spencerp theone.andonly.mr.awesome at gmail.com
Wed Mar 5 01:26:22 GMT 2008


Jeremy Visser wrote:
> I later realised that won't work, because it's still using
> the_permalink() and the_title() later on.
>
> We need to do some query_posts() mojo.
>   

LOL!

> Like maybe
>
> <?php
>
> global $wp_query, $wp_old_query;
> $wp_old_query = $wp_query;
>
> query_posts('numberposts=10&offset=0');
>
> while ( have_posts() ) :
> the_post();
>
> ?>
> <li>
> 	<ul>
> 		<li><a href="<?php the_permalink(); ?>" title="<?php the_title() ?>"><?php the_title() ?></a></li>
> 	</ul>
> </li>
> <?php
>
> endwhile;
> $wp_query = $wp_old_query;
>
> ?>

Just tried that, and gives me following error:

Parse error: syntax error, unexpected '?' in C:\Program 
Files\xampp\htdocs\wp-content\themes\TheVindictiveBastardTheme1\header.php 
on line 55

I'm not a coder professional so... not sure about all this hacking code 
stuff LOL!


More information about the wp-hackers mailing list