1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Wordpress Recent Posts Shows Pending Posts..?!

Discussion in 'Web Design & Development' started by MarkHaigh, May 11, 2010.

Thread Status:
Not open for further replies.
Advertisement
  1. MarkHaigh

    MarkHaigh Thread Starter

    Joined:
    Mar 21, 2010
    Messages:
    32
    Hi all,

    I'm using the Wordpress function wp_get_recent_posts - the output is fine except for the fact it outputs posts that are still pending..! (And if you click the link you get a 404 error, because it is pending).

    Same for posts that are draft or marked private.

    I see no options on the function to specify post status but surely by default it should only output Published posts..?

    This is the latest version (WP2.9.2).

    Confused..!
     
  2. MarkHaigh

    MarkHaigh Thread Starter

    Joined:
    Mar 21, 2010
    Messages:
    32
    No-one else come across this problem?
     
  3. colinsp

    colinsp

    Joined:
    Sep 5, 2007
    Messages:
    1,834
    You may be better off asking on the WordPress forum, there are more experts on it there than here. I use WP a lot and have not come across that problem.
     
  4. Gigacore

    Gigacore

    Joined:
    Jul 19, 2007
    Messages:
    577
  5. MarkHaigh

    MarkHaigh Thread Starter

    Joined:
    Mar 21, 2010
    Messages:
    32
    Thanks - using get_posts does seem to be the answer to this.

    It's odd that wp_get_recent_posts hasn't even been deprecated yet. I just managed to find a blog post from 2005 discussing the same bug/undocumented feature.
     
  6. Gigacore

    Gigacore

    Joined:
    Jul 19, 2007
    Messages:
    577
    You are welcome, Mark! I'm glad it helped you :)
     
  7. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/922548