WordPress 2.6 Issue: get_posts() is Broken

get_posts(), a key ingredient for creating multiple loops in WordPress, appears to be broken after on the 2.6 release. Here’s a forum post seeking for help. I first came into this problem from Dan Philibin‘s tweet regarding problem with WPCandy.

This problem would affect many sites, I would imagine, especially those with more complex ways to display its content. I suppose a quick fix is in the way soon.

6 Responses to “WordPress 2.6 Issue: get_posts() is Broken”

  1. WordPress 2.6 is beschikbaar : I-Dimensie

    [...] de tweede bug werd door Dan Philibin van WP Candy (meer info hier) en gaat om het  get_posts() php commando. Een oplossing is nog niet bekend voor zover mij [...]

  2. Issues met WordPress 2.6 : I-Dimensie

    [...] de tweede bug werd door Dan Philibin van WP Candy (meer info hier) en gaat om het  get_posts() php commando. Een oplossing is nog niet bekend voor zover mij [...]

  3. The State of WordPress’s Upgrade Cycle :: WPLover

    [...] case you’ve forgotten, the 2.6 release also brought at least two different errors: get_posts() and Permalink with “index.php” [...]

  4. Issues met WordPress 2.6 | Myweb-Blog.nl

    [...] de tweede bug werd door Dan Philibin van WP Candy (meer info hier) en gaat om het get_posts() php commando. Een oplossing is nog niet bekend voor zover mij [...]

  5. WordPress 2.6 bugs and fixes | WordPress Philippines

    [...] you have a custom theme that uses multiple loops, chances are it uses get_posts. Unfortunately there are several problems with the function in this version, so you might be better off using [...]

  6. Holiday Guru

    There is a behaviour chaneg in get_posts() but not sure if its intended! It grabs ALL posts now and you have to manually work out if the post is one you want. I set up a sidebar to display posts in the category of teh page you are on using the following code, however it isn’t quite perfect because on Index and Category pages it still reads all posts in the database and uses the latest one as teh default. But it works on articles:

    $found = 0;
    $count = 0;
    $ID = $wp_query->posts[0]->ID;
    $category = get_the_category($ID);
    $cat = $category[0]->cat_ID;
    $catposts = get_posts(‘numberposts=999999&category=$cat’);
    foreach($catposts as $post) :
    $thisID = the_ID();
    $postID = $wp_query->$thisID;
    $postCategory = get_the_category($postID);
    $postCat = $postCategory[0]->cat_ID;
    if ($postCat == $cat && $count
    <a href=”">

Leave a Reply

Latest Links More →

Custom Shortlinks for WordPress

Have your own short domain name for the purpose of shortlinking? Here’s an easy way to combine that with your WordPress install.

The Quick Start Guide to Using Google Webmaster Tools With WordPress

GWT is a great, frequently updated features like showing you search queries volume, malware and crawl error diagnostics and links to your site. If you don’t use it yet, you probably need to. This will help you get started.

WordPress & jQuery Contact Form without a Plugin

I would recommend this either if you want more flexibility or to learn how to code a contact form.

Understanding and cleaning the pharma (spam) hack on WordPress

How to fix that hack:

This attack is very interesting because it is not visible to the normal user and the spam (generally about Viagra, Nexium, Cialis, etc) only shows up if the user agent is from Google’s crawler (googlebot). Also, the infection is a bit tricky to remove and if not done properly will keep reappearing.

Web Safe Fonts Cheat Sheet

An updated (written in April 2010), well researched, CC-licensed Web safe fonts cheat sheet, available both in low-res PNG and high-rest PDF. Even the article is useful as well.

The Nicest 2010 Child Theme You’ll See Today

The Timaru Mental Health Support Trust website, made for charity by Team USA (comprised by web superstars like Jason Santa Maria, Dan Mall, Liz Danzico and Automattic’s John Ford) during the FullCodePress competition, is actually a clever child theme of 2010.

More recap by JSM, Daniel Mall, and Liz Danzico.

WordPress 3.0 Theme Tip: The Comment Form

The simpler way to code comment form (once you understand how hooks and filters work).

Showing and hiding content with pure CSS3

I like it, I think it’s short and easy to understand.