• Resolved samuelf

    (@samuelf)


    Hi guys,
    I’ve just upgraded to 2.6, and I’ve got quite an annoying problem going on.

    I have a heavily customised front page, and I used the following script to pull the latest three posts from a number of categories:

    <?php
     global $post;
     $myposts = get_posts('numberposts=1&offset=0&category=34');
     foreach($myposts as $post) :
     setup_postdata($post);
     ?>

    But for some reason, since upgrading this code doesn’t work properly, and it just pulls the latest three posts from ANY category. So I’ve just got lists of the same three posts instead of category specific ones, no matter what category ID I enter into the code.

    Any ideas on what might be causing this, and how I can fix it? Apologies if it’s something daft, I’m not great at this!

    Thanks in advance ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter samuelf

    (@samuelf)

    Never mind, turns out the “Simply Exclude” plugin was giving me grief!

    EDIT: Sorry, I should have just edited the first post instead of posting again.

    Anyway, hope it helps someone else!

    Optimiza

    (@malditoweekend)

    Samuelf:

    Look, in my index page I have the normal posts, plus I have a side column inside the normal posts that is called QUICKNOTES, I only show there small posts. I use the Category Excluder Plugin, plus this code to exclude that category from the normal posts:

    <?php
    $myAsides = get_posts('numberposts=9&category=43');
    foreach($myAsides as $post) :
    setup_postdata($post);
    ?>

    Since I upgrade to WP 2.6 that code doesn′t work anymore and is showing the category that I want to hide inside the normal posts.

    Can you help me to figure it out how can I make it work again?

    Regards!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘2.6 problem with ‘get_posts’’ is closed to new replies.