WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] WP 2.1 RC1 - some code in my functions.php stopped working. (4 posts)

  1. sadish
    Member
    Posted 7 years ago #

    Hi,

    I had this bit of coding in my functions.php that stopped working.

    it looks like this.
    global $wpdb;
    $results = $wpdb->get_results("SELECT ID, post_title from $wpdb->posts WHERE post_status='static' AND post_parent=0 ORDER BY post_title");

    what might be the cause ?

    Thanks
    Sadish

  2. moshu
    Member
    Posted 7 years ago #

  3. sadish
    Member
    Posted 7 years ago #

    Thanks moshu,

    Ryan mentioned in his recent post announcing the release candidate, that I can also post in this forum.
    Anyway I figured it out myself.

    post_status is not used for identifying whether it is a post / page.
    now they use post_type field for that purpose.

    Sadish

  4. Ryan Boren
    WordPress Dev
    Posted 7 years ago #

    Devs our monitoring this forum now that the RC is out. It is a beta forum, right?

    sadish, post_type is indeed what you want. Check for post_type = 'page'.

Topic Closed

This topic has been closed to new replies.

About this Topic