WordPress.org

Forums

The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Filter Posts by different custom fields values (2 posts)

  1. chocks
    Member
    Posted 6 years ago #

    Hi guys,

    I tried searching different alternatives to my question, but I had no luck*.

    I'm trying to get a search result based on custom fields meta data, say:
    Price: $100 - $400
    Location: Buenos Aires
    Type: All

    These options should be on the frontend and their values can be specific ones or not defined (meaning, "all"). Is there any way to achieve this? I'd like the user to click on "Search" after chosing these values..

    Result should be, as *expected*, all pages or posts (in this case pages) with those values. I wouldn't mind defining the parent page ID where every page (which I want to filter) is.

    My page tree is:
    Home
    About
    Group Page
    -Group page 1 + custom fields
    -Group page n + custom fields
    Contact Us

    *I found Scribu's plugin:
    http://wordpress.org/extend/plugins/custom-field-taxonomies/ which looks amazing but can't figure out how to implement it the way I'd like it to work.

    Also, Mike from WP-Hackers list told me to look at http://codex.wordpress.org/Custom_Queries but wasn't as deep as I expected..

    Thanks a mil if you can give me a clue on this one!

    J

  2. Darrell Schauss
    Member
    Posted 6 years ago #

    This might help for using the query_posts function
    http://codex.wordpress.org/Function_Reference/query_posts#Custom_Field_Parameters

    For more in depth control.
    If you know how to work with SQL statements. This one shows custom select queries of posts based on custom fields.
    http://codex.wordpress.org/Displaying_Posts_Using_a_Custom_Select_Query

Topic Closed

This topic has been closed to new replies.

About this Topic