The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
0answers
507 views

How to use Meta Value Compare in WP_Query For Max and Min numbers

I am using WP_Query for visitor to filter the posts. The posts is about products. So in the filter, it has a field where user can select Maximum price and Minimum price. (Just like most of the ...
0
votes
1answer
2k views

Order by custom field date with ASC order

I've found several similar question but none of them explains why the below is giving me nothing with ASC order. It works with DESC. Basically it's a query that should list posts where the custom ...
0
votes
3answers
375 views

trim custom field text value and show (…)

I am using this code here: <?php $trim_length = 25; //desired length of text to display $custom_field = 'my-custom-field-name'; $value = get_post_meta($post->ID, $custom_field, true); if ...
1
vote
1answer
523 views

How can I display all values of a custom field from posts with a certain value of another custom field or from certain post types?

I know the question is quite ambiguous. Let me explain: I have a page that lists all posts with a certain value of a custom field. (Eg.: The page Rentals lists all posts with the value rental of ...
0
votes
1answer
221 views

Show array of meta_value in Edit Post Coloum

what I'm trying to do is add a new coloumn to Edit post page (done) and in that coloumn show data taken from a set of custom fields (partially done). This is my code (I use it as a plugin so it ...
0
votes
1answer
160 views

How to avoid duplicating same meta_value?

I have "publication_year" as meta_key for some images/attachments. I want to list all meta_values inside html table, but I don't want same publication_year value to repeat, my code is: <?php $args ...
0
votes
1answer
862 views

Override orderby to create list of users by custom meta_value

I'm having issues ordering a loop of users by a custom meta_value. Reading the Codex for get_users(), it doesn't actually say that you can use the meta_value for orderby. When I try to do it I get a ...
3
votes
3answers
2k views

SELECT max(meta_value) FROM wp_postmeta WHERE meta_key='price'… stops working when value is over 999

Overview: I am not trying to return a post. I simply want the single highest value for a particular meta_value across all posts... just the value itself. Details: I have added a custom meta_key ...
0
votes
1answer
434 views

query_posts, oderby meta_value & print “future” posts

I have a custom post type for a cycling club uses to schedule rides. There is a custom field for these posts where the user selects the "ride date" with JQUI date & time picker. This information ...
0
votes
1answer
676 views

Custom WP Query from meta_value stored as serialised array

I'm using a Magic Fields 2 multicheck box to store Services which can be assigned to Case Studies. The data is stored as a serialised array in WordPress, and I need some help to extract the "related ...
1
vote
1answer
3k views

Filter by custom field (meta_key) using JSON API

Hi I'm using the great JSON API for Wordpress and would like to filter my custom post types by a specific custom field (using the meta_key and meta_value params). The query in my URL looks like this ...
3
votes
1answer
654 views

Max length of meta_value

I was wondering if anyone could tell me the max length of the meta_value field for posts and user meta. Thanks!
0
votes
2answers
213 views

How to order by multiple date meta_values?

I am trying to find some way when using WP_Query of ordering by multiple meta_values. I know I can order by multiple values and I know how to order by meta_values but I cant seem to figure out how to ...
0
votes
1answer
1k views

Help With issue on pre_get_posts filter in taxonomy

I create a function to filter the taxonomy query with this code add_action('pre_get_posts', 'custom_taxonomy_query'); $option_taxposts_per_page = get_option('tax_posts_per_page'); function ...
0
votes
1answer
469 views

How to sort posts by the average of comment meta values

Here's the situation- I've customized the comment submission whereby users can provide a rating, and this gets stored as a meta value in the commentmeta table. I can query to return the average ...
0
votes
1answer
784 views

Using a pre_get_posts filter to search for multiple strings on all meta values

Using a pre_get_posts filter to search a given string on all meta_values: $query->set('meta_value', 'first string'); debug: AND ( (CAST(wp_postmeta.meta_value AS CHAR) = 'first string') ) ...