Title: 2.6 problem with &#8216;get_posts&#8217;
Last modified: August 19, 2016

---

# 2.6 problem with ‘get_posts’

 *  Resolved [samuelf](https://wordpress.org/support/users/samuelf/)
 * (@samuelf)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/26-problem-with-get_posts/)
 * 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](https://wordpress.org/support/users/samuelf/)
 * (@samuelf)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/26-problem-with-get_posts/#post-809701)
 * 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](https://wordpress.org/support/users/malditoweekend/)
 * (@malditoweekend)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/26-problem-with-get_posts/#post-810192)
 * 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.

## Tags

 * [get_posts](https://wordpress.org/support/topic-tag/get_posts/)

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 2 replies
 * 2 participants
 * Last reply from: [Optimiza](https://wordpress.org/support/users/malditoweekend/)
 * Last activity: [17 years, 10 months ago](https://wordpress.org/support/topic/26-problem-with-get_posts/#post-810192)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
