WordPress.org

Ready to get started?Download WordPress

Forums

Filter post list with a custom field. (4 posts)

  1. usuario
    Member
    Posted 7 years ago #

    Ok folks, I'll be simple to get a fast response =)

    I have a custom field called "status", how to make a query to only show posts with "status=1"?

    I know that c2c_get_custom('custom_file_name') return the value of the custom field, but I don't know how to put that inside the query_posts like for example:

    <?php query_posts('showposts=5'); ?>

    EDIT:

    I'm currently trying to do something like this:

    while(have_posts()) {
    the_post();
    if (c2c_get_custom('status') == "1") {
    // display post
    }

    But I was wondering if there is any other better way to do that.

    EDIT: Please, some moderator change this topic to the right area, sorry for that. I guess its "plugins/hacks".

  2. usuario
    Member
    Posted 7 years ago #

    nobody?? =/

  3. jasontremblay
    Member
    Posted 7 years ago #

    I'm really interested in doing something similar. Anyone out there have any suggestions?

  4. usuario
    Member
    Posted 7 years ago #

    Heheh.. hey jasontremblay, I got almost what I want, but not 100% yet, try look at: http://wordpress.org/support/topic/93438?replies=8#post-558741

Topic Closed

This topic has been closed to new replies.

About this Topic