Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Web Design & Development Web Design & Development
Search Search
Search for:
Tech Support Guy > > >

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


(!)

MarkHaigh's Avatar
MarkHaigh MarkHaigh is offline
Member with 32 posts.
THREAD STARTER
 
Join Date: Mar 2010
Location: UK
11-May-2010, 11:51 PM #1
Question Solved: Wordpress Recent Posts Shows Pending Posts..?!
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..!
MarkHaigh's Avatar
MarkHaigh MarkHaigh is offline
Member with 32 posts.
THREAD STARTER
 
Join Date: Mar 2010
Location: UK
15-May-2010, 06:40 PM #2
No-one else come across this problem?
colinsp's Avatar
colinsp   (Colin) colinsp is offline
Computer Specs
Member with 1,662 posts.
 
Join Date: Sep 2007
Location: Spain
16-May-2010, 02:10 AM #3
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.
Gigacore's Avatar
Gigacore Gigacore is offline Gigacore has a Profile Picture
Gigacore has a Photo Album
Computer Specs
Member with 577 posts.
 
Join Date: Jul 2007
Location: Bangalore
Experience: You mean XP ?
16-May-2010, 06:58 AM #4
@Mark, wp_get_recent_posts is outdated template tag. Now there is a new way to do this.

Try this method: http://www.noob2geek.com/wordpress/h...-in-wordpress/
MarkHaigh's Avatar
MarkHaigh MarkHaigh is offline
Member with 32 posts.
THREAD STARTER
 
Join Date: Mar 2010
Location: UK
16-May-2010, 06:22 PM #5
Quote:
Originally Posted by Gigacore View Post
@Mark, wp_get_recent_posts is outdated template tag. Now there is a new way to do this.
/
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.
Gigacore's Avatar
Gigacore Gigacore is offline Gigacore has a Profile Picture
Gigacore has a Photo Album
Computer Specs
Member with 577 posts.
 
Join Date: Jul 2007
Location: Bangalore
Experience: You mean XP ?
17-May-2010, 09:37 AM #6
You are welcome, Mark! I'm glad it helped you
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
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.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Title Thread Starter Forum Replies Last Post
Show more posts on a wordpress blog robobobo Web Design & Development 4 08-Nov-2009 02:15 PM
Secure Wordpress cmshelper General Security 1 16-Jul-2009 07:43 AM
Wordpress php editing, two problems ... DaveSS Web Design & Development 0 27-Feb-2009 09:43 AM
Wordpress & Google gears NexusV2 Web Design & Development 0 25-Jan-2009 08:25 AM
wordpress IE6 help nev02 Web Design & Development 2 07-Jan-2009 09:29 AM

WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑