WordPress.org

Ready to get started?Download WordPress

Forums

HOW to Just include a SQL query in the post listing? (8 posts)

  1. usuario
    Member
    Posted 7 years ago #

    HOW to Just include a SQL query in the post listing?

    I want to filter the post listing with only posts that have "meta_key" = post_status and "meta_value" = 1, in the postmeta table.

    Thx...

  2. pizdin_dim
    Member
    Posted 7 years ago #

    Read up on the loop in action. Also, see this post for more info.

  3. usuario
    Member
    Posted 7 years ago #

    Well... I tried, but it doesn't work. I can use the query_posts('posts_per_page=-1'); before the loop and it works, give me all posts. But I can't make a 'sql query' to show me ONLY posts with meta_key=status with meta_value=1.

    I tried this:

    query_posts($query_string . '&meta_key=post_status&meta_value=1&posts_per_page=5');

    Which would be really what I want, but didn't work... =(

    Could you do that for me?

    Thx

  4. usuario
    Member
    Posted 7 years ago #

    ???? PLS, urgent!

    It's simple but I just couldn't get it working, I need to filter a normal post listing with a meta_key, meta_value. =/

  5. usuario
    Member
    Posted 7 years ago #

    Well... nobody tried to help, I'm here spending my time in a simple detail that someone who knows how to manage this queried could do fast for me... anyways, I found something VERY IMPORTANT, from this topic: http://wordpress.org/support/topic/93438?replies=6

    I'm really glad that Kafkaesqui posted the link to this plugin (Custom Home, Display only those posts on your home page with a specific custom field key (and optional value).)

    The problem is... I tried to use the plugin, everything seems to work, but when I tried to access the "previous page" (url: page2), it gives me Error not found... =(

  6. drmike
    Member
    Posted 7 years ago #

    First I've seen of this thread. I was going to help but since you're being a rudeass...

  7. usuario
    Member
    Posted 7 years ago #

    hey, come on... me, "rudass" ?? Just because I said that nobody was able to help 8 hours after??

    Well... I appreciate any help, including yours if you change mind.

  8. usuario
    Member
    Posted 7 years ago #

    .... Anyone? :)

Topic Closed

This topic has been closed to new replies.

About this Topic