Skip to main content

Questions tagged [custom-field]

Custom Fields are fields that can hold arbitrary extra information known as meta-data.

78 votes
3 answers
196k views

WP_Query - Order results by meta value

I've checked around and haven't seen an answer which works as of yet. I have a WP_Query with the following arguments: $args = array( 'post_status' => 'publish', 'post_type' => 'listing',...
Adam Moss's user avatar
  • 1,052
67 votes
2 answers
114k views

How can I add an image upload field directly to a custom write panel?

I've added a new page under "Pages" in the wordpress admin, and added several custom fields. I'd also like to be able to add an upload image field to the page editor - is there some way to do this via ...
Will's user avatar
  • 893
56 votes
3 answers
86k views

Add filter menu to admin list of posts (of custom type) to filter posts by custom field values

This answer is very close to what I am looking to do, but instead I would like to specify a specific custom field and display a select menu of its available values. Thanks!
adam5280's user avatar
  • 693
54 votes
7 answers
66k views

getting all values for a custom field key (cross-post)

I know how to get a custom field value for a specific post. get_post_meta($post_id, $key, $single); What I need is to get all the values associated with a specific custom post key, across all posts....
mikkelbreum's user avatar
  • 2,466
51 votes
6 answers
39k views

Extending the search context in the admin list post screen

I have created a custom post type and have attached some custom fields to it. Now I would like to the search that authors can perform on the custom post list screen (in the admin backend) to also be ...
Stefano's user avatar
  • 1,261
47 votes
8 answers
163k views

Custom query with orderby meta_value of custom field

Aa you know, as of WP3.0 there are options for custom advanced queries, which is great. As of this, some query parameters of custom fields like meta_key, meta_value were deprecated for the new ...
Maor Barazany's user avatar
45 votes
2 answers
36k views

How to add a custom field in the advanced menu properties?

Is it possible to add a custom field to menu items? What I want to do is be able to add a field for 'French Navigation Label' and a 'French Title Attribute' in the wp menu interface.
cbaigorri's user avatar
  • 822
41 votes
1 answer
29k views

How to filter post listing (in WP dashboard posts listing) using a custom field (search functionality)?

Despite the fact I googled a lot, I've not found the answer to a very simple question : I have some posts with a custom field (i.e. supplier_name). I would like to be able to search and filter my ...
jean04's user avatar
  • 411
40 votes
13 answers
103k views

Using meta query ('meta_query') with a search query ('s')

Trying to build a search that not only searches the defaults (title, content etc) but also a specific custom field. My current query: $args = array( 'post_type' => 'post', 's' => $query, ...
luke's user avatar
  • 649
38 votes
4 answers
85k views

what is the correct way to compare dates in a WP query_posts meta_query

I have a query_posts call in a WP template. Through the use of the More Fields Plugin I can give the site admin the ability to create an event (custom post type) and then enter a date which is ...
tjsherrill's user avatar
37 votes
7 answers
42k views

Adding Fields to the Category, Tag and Custom Taxonomy Edit Screen in the WordPress Admin?

The question is "How do I add one or more fields to the Category, Tag and Custom Taxonomy Edit Screen in the WordPress Admin?" This question was asked on the wp-hackers list August 1st 2010 and I ...
MikeSchinkel's user avatar
  • 37.5k
33 votes
8 answers
155k views

How to Add Custom Fields to a Custom Post Type?

Ok, so I have registered a few custom post types and a few taxonomies. Now, for the life of me, I cannot figure out the code I need to add a Custom Field to my Custom Post Type. I need a drop down ...
xLRDxREVENGEx's user avatar
33 votes
3 answers
36k views

Can I exclude a post by meta key using pre_get_posts function?

I see many people prefer to use pre_get_posts hook instead of query_posts. The code below works and shows all posts which have meta key "featured" function show_featured_posts ( $query ) { if ( $...
Carlisle's user avatar
  • 351
32 votes
5 answers
53k views

Query to sort a list by meta key first (if it exists), and show remaining posts without meta key ordered by title

I'm working on a custom taxonomy term page template where we want the items that are connected to the term sorted by a publication date (custom date field) - and if there are multiple items on the ...
CSSgirl's user avatar
  • 746
32 votes
4 answers
71k views

Advanced search form with filters for custom taxonomies and custom fields

I'd like to build an advanced search form for a specific custom post type, having filters for the custom post types custom fields, custom taxonomies, and for a separate custom post types properties (...
pax's user avatar
  • 633

15 30 50 per page
1
2 3 4 5
248