• Resolved billsall54

    (@billsall54)


    I cannot get the where clause to work. I do not get syntax error. It simply does not function. Does this feature work or am I entering it incorrectly.

    Here is shortcode for page:

    [pods name=”business” orderby=”business_name” limit=”100″ where=”city=”Napa”” template=”Businesses Quick List Template”]

    Thanks for your help.

    https://ww.wp.xz.cn/plugins/pods/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Jim True

    (@jimtrue)

    You’re using the wrong kinds of quotation marks around Napa in the where clause. You should be getting some kind of error though, but maybe it’s only a debug warning.

    Try This:

    [pods name="business" orderby="business_name" limit="100" where="city='Napa'" template="Business Quick List Template"]

    I can’t use a custom field in the where clause:

    [pods name="news" orderby="news_date DESC" where="remain_top_list ='1'" limit="-1" template="News Listing Item" pagination="true"]

    remain_top_list works as an orderby clause, but not as a where clause.
    (it also breaks if I try 2 orderby clauses)

    Plugin Contributor Jim True

    (@jimtrue)

    Please don’t add your questions to someone else’s resolved question.

    remain_top_list.meta_value is what you should be using. remain_top_list is a custom field

    Actually he would’ve received an error on city as well, it should’ve been city.meta_value if that was a custom post type, city.name if that was a custom taxonomy.

    You can only use one orderby clause in a shortcode. If you need it orderby’d multiple fields, separate them with a comma

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Where Clause does not work’ is closed to new replies.