[wp-hackers] get_posts problem...

Dan Larkin nitephire at gmail.com
Wed Mar 5 01:59:06 GMT 2008


I could be mistaken, but it seems a bit odd to have "$wp_query =
$wp_old_query;" twice.  I believe the first one should be removed?

Note: I've been debugging an assembly language program (for decryption of a
transposition cipher) for the past two hours (it's still an ongoing process
and will probably last another 2-4), so my brain might just be a bit too
fried for its own good and you should take anything I say with a grain of
salt.

:: Dan Larkin

On 3/4/08, Mr. Awesome <theone.andonly.mr.awesome at gmail.com> wrote:
>
> Dan Larkin wrote:
> > No go as in still a parsing error about a "?" or no go as in that method
> > didn't work?
>
>
> The method(s) not working. We're trying various things, here I'll tell
> you what we're doing and the results...
>
> method 1:
>
>
> <h4>latest<span class="altcolor"> posts</span></h4>
>         <?php
>
> $posts = get_posts('numberposts=10&offset=0');
> foreach ($posts as $post) : ?>
>
> <li>
> <ul>
> <li><a href="<?php the_permalink(); ?>" title="<?php the_title();
> ?>"><?php the_title(); ?></a></li>
> </ul>
> </li>
>
> <?php endforeach; ?>
>
> Result: Shows the Latest Posts titles in top section like they supposed
> too, but there's still a normal POST on the Authors page... and not the
> Author page content...
>
> Method 2:
>
>
> <h4> latest <span class="altcolor">posts</span></h4>
>
> <?php
> global $wp_query, $wp_old_query;
> $wp_old_query = $wp_query;
>
> query_posts('numberposts=3&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
>
> $wp_query = $wp_old_query;
>
> endwhile;
> $wp_query = $wp_old_query;
> ?>
>
>
> Result: Shows the Latest TWO post titles in above section, and TWO posts
> in the author page, instead of one as we had in first Method. No Author
> Page content showing at all...
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list