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.

How I could made a sql query who retrieve all the sticky post in a wordpress database? This is because we use a new app over the old wordpress website database, and I don't know where Wordpress "store" the sticky attribute.

Thanks in advance

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

It's not stored as attribute, but as list of all stickies. Snippet from core:

$sticky_posts = get_option('sticky_posts');

So look for the option and then use IDs to retrieve posts.

share|improve this answer
    
But inside the database is stored in some form, no? I can't use the php code, because I have only the database, so I only could use sql. –  Nisanio Jun 28 '11 at 21:22
    
@Nisanio it's in option, so look in options table (wp_options or whatever your db has) –  Rarst Jun 28 '11 at 21:27
add comment

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.