Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

My website is a multi author blog. I would like to give special promotion for the first 100 published posts in my blog?

What is the proper way to implement it? I mean should i add some meta value for first 100 published posts and then query it later using that meta value?

If yes can anyone tell me how? Thanks

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Here is what I would do:

Run an SQL query like so:

SELECT * FROM `wp_posts` WHERE `post_status` = 'publish' AND `post_type` = 'post' GROUP BY `post_author` ORDER BY `post_date` ASC  LIMIT 100

The above will give you the first 100 authors to have a post published. or:

SELECT * FROM `wp_posts` WHERE `post_status` = 'publish' AND `post_type` = 'post' ORDER BY `post_date` ASC  LIMIT 100

this will give you the first 100 published posts

share|improve this answer
    
Awesome Brady :). Thanks –  Giri Apr 17 '12 at 16:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.