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

learn more… | top users | synonyms (2)

34
votes
3answers
45k 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 ...
21
votes
2answers
10k 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.
20
votes
6answers
10k views

Add validation and error handling when saving custom fields?

I have a function that defines a custom field on a post type. Say the field is "subhead". When the post is saved, I want to do some validation on the input, and display an error message on the post ...
17
votes
1answer
8k 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 (ie supplier_name). I would like to be able to search and filter my posts ...
17
votes
5answers
13k 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 ...
16
votes
4answers
28k 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 that custom type's custom fields and custom taxonomies AND for another custom type's properties (fields ...
13
votes
5answers
11k 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 ...
11
votes
4answers
20k views

WP insert post PHP function and Custom Fields

The wordpress function is used for submitting data programatically. Standard fields to submit to incude the content, excerpt, title, date and many more. What there is no documentation for is how to ...
11
votes
4answers
7k 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 ...
10
votes
2answers
3k views

Help Creating a Slideshow Custom Post Type with Custom Meta Boxes?

I need to create a custom post meta box(es) for my custom post type "Slideshow" (this post type is already created). Each metabox will hold the content in each slide slide and save it to ...
9
votes
2answers
8k views

Custom field/meta populated by dropdown of existing posts?

(My first WP question ever asked! Be gentle!) I'm building a site that is mostly pages (i.e., static), using WP as CMS. At the bottom of several of the pages, there will appear 1, 2, or 3 "promo ...
8
votes
3answers
6k views

Validating Custom Meta Box Values & Required Fields

Something which I have never seen covered is the best way to validate that specific form fields are filled out correctly for custom post type meta boxes. I am looking to get expert opinions on how ...
8
votes
3answers
3k views

Custom Post Type Data in Sidebar widgets?

(note: this question was originally about Custom Fields, but @MikeSchinkel had a better solution involving Custom Post Types) On my site I have several pages which I want to show the same data in the ...
8
votes
1answer
643 views

Any way to add custom options to Gallery Settings?

Now that Wordpress has updated to version 3.5, the media gallery has been overhauled and this custom options solution doesn't appear to work anymore. I'd like to add a couple of fields to the gallery, ...
7
votes
1answer
8k 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!
7
votes
4answers
2k views

Extending the search context in the admin list post screen

I have a created a custom post type and have attached some custom fields to it. Now I would like for the search that authors can perform on the custom post list screen (in the admin backend) to also ...
7
votes
2answers
2k views

Programatically add options to “add new” custom field dropdown

How can I add pre-defined options to the "add new" custom field dropdown? Here's two examples of automatically adding and showing new custom fields: WordPress: Adding Default Custom Fields on New ...
6
votes
3answers
2k views

Possible to turn off autosave for single custom post type

So I'm having an issue with my custom fields in my custom post type. For whatever reason the fields save and then clear somewhat randomly... I'm sure it's not random but I'm not sure what's triggering ...
6
votes
7answers
3k views

Individual Widgets per Page

In my (page-only, no posts) Wordpress site I have a number of static blobs in need to put in a sidebar. We could call/tream thoses 'blobs' as widgets. At least they'll have a fixed html content, like ...
6
votes
2answers
331 views

How do I improve this admin query snippet to avoid generating duplicate results on non-meta searches?

I've been playing around with code snippets which add meta data to admin searches. The best snippet I've found was written by Stefano on this question. However, it appears to have 1, annoying bug ...
6
votes
1answer
77 views

Is it safe to store a user setting you don't want the user to ever modify as a user option?

I have added some custom user options to the profile page on my site, and most are all OK for the user to modify themselves. These options live in their own section. The users have read access and ...
6
votes
1answer
6k views

How set featured posts using checkbox in post edit screen?

I want to make selecting a featured post is just by checking a checkbox in edit screen AND be able to retrieve these featured articles from only specific category ? in short what I'm looking for : ...
6
votes
3answers
359 views

Adding custom input for data attribute in insert media modal

I'm trying to add a text input to the "Insert Media" modal in the hopes of being able to add an html5 data- attribute to the images' parent anchor. <a class="fancybox" href="..." ...
6
votes
1answer
134 views

How to protect pages with double authentication: password + email (in custom field)

I would like to extend the WordPress password protection of posts by adding extra input field for user email. So in order to see the content user will have to know the password and previously given ...
6
votes
1answer
2k views

Best way to programmatically remove a category/term from a post

I am working on a script to convert all posts in a given category to use a postmeta flag instead (testing of MySQL has shown me that on a site as large as mine this will lead to a meaningful decrease ...
6
votes
3answers
2k views

Display custom post type and custom fields within a Bootstrap Carousel

I am using the "Types" wordpress plugin for the first time. I created a custom post type, as well as some custom fields. How do I dynamically call all the custom posts into a Bootstrap carousel, ...
5
votes
1answer
14k 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 arguements: $args = array( 'post_status' => 'publish', 'post_type' => ...
5
votes
4answers
5k views

Attaching Metadata to a Taxonomy Item

I have a taxonomy of menus i.e. Coffee, Tea, Sandwiches, Cakes etc. I want to add more information 'about' the taxonomy such as an image that represents it alongside the other pieces of taxonomy ...
5
votes
1answer
17k views

How to enable custom fields for pages (if not a bad practice)?

My main page has a intro image beside the main content. I would like to add that image using custom fields. I've noticed that pages don't have. I would like to enable them. Is it a bad practice?
5
votes
3answers
5k views

don't publish custom post type post if a meta data field isn't valid

I have a custom post type (CPT) called event. I have a meta box for the type with several fields. I would like to validate some fields before publishing an event. For example, if an event's date is ...
5
votes
1answer
5k views

Using meta_query, how can i filter by a custom field and order by another one?

With the following code (in functions.php) my posts (of CPT event) are ordered by _end_date instead of _start_date. What's the proper solution to this as of WP 3.1.3? Of course I'd like to avoid using ...
5
votes
4answers
2k views

Does Wordpress have a “Form API”

I do most of my development in Drupal, however I am working on a Wordpress site and I need to make a form. Which got me thinking, is there a Form API for wordpress like there is Drupal? Is there a way ...
5
votes
6answers
4k views

How can I make wp-pagenavi work on a custom query built upon a form submission?

I've also posted this on the wordpress support forums, for scribu's wp-pagenavi plugin: http://wordpress.org/support/topic/plugin-wp-pagenavi-custom-query-form-submit-part-2?replies=1 My situation: ...
5
votes
2answers
3k views

How to correctly call custom field dates into a posts_where filter using SQL statements

Currently I have the loop listing posts between two dates using the posts_where filter: function filter_where( $where = '' ) { $where .= " AND post_date >= '2000-01-01' AND post_date <= ...
5
votes
1answer
225 views

Add 'Description' to taxonomy 'Quick Edit'

This seems fairly straight forward, but I cannot find a definite guide on how to add the taxonomy description field to the quick edit box. I've followed several tutorials on adding fields to the ...
5
votes
1answer
899 views

Filter post listing by meta value which is a date

This question is almost what Im trying to achieve. Create a filter for posts based on a custom field. My custom field is a date and I would like to create a date filter (monthly) based on this custom ...
5
votes
4answers
4k views

Prevent post from being published if custom fields not filled

I have a custom post type Event that contains a starting and ending date/times custom fields (as metaboxes in the post edit screen). I would like to make sure that an Event cannot get published (or ...
5
votes
3answers
5k views

Custom Post Type - Taxonomy Dropdown Menu?

I have created a custom post type and added various meta boxes/fields to this custom post type. All is working excellent except for one element... Instead of utilizing the default interface for ...
5
votes
3answers
6k views

Custom search: by post data and post metadata?

I'm struggling with a WordPress search function. Maybe it will just help if someone can explain to me how the built in WordPress function works. But here's what I want: Two search fields, by name ...
5
votes
2answers
190 views

Tabindex on text input immediately after WordPress title input

The following code adds a text input for a subtitle to the space directly below the title input, via the edit_form_after_title hook. However, when editing the title, pressing tab moves the cursor to ...
5
votes
2answers
1k views

What should I use - Taxonomies, custom fields, Post Type?

I've setup a traveling/photography blog. I want to have different post types: Traveling, Hotel Reviews, etc. For the traveling post, I want to add unique data like: City, Weather (for the current time ...
5
votes
1answer
2k views

Put the media uploader in a metabox

I find it very unnecessary to have an "add image" button that brings me to yet another screen that will let me upload content to my post. Ideally I would like to have a meta box with the option to ...
5
votes
3answers
3k views

Sortable Custom Columns in User Panel (users.php)?

I'm using Register Plus Redux plugin to augment a registration form with custom metadata fields. These fields display at the bottom of each user record detail page and they can be retrieved with ...
5
votes
1answer
243 views

Need small coding with Custom Fields Search

WP Custom Fields Search is a great plugin but I've a problem regarding the plugin returning results using the homepage. When I click the submit button, results are shown on the homepage instead of ...
5
votes
1answer
527 views

Change behavior of “Insert into Post” based on attachment metadata

For a custom plugin I'm working on, I have added a checkbox element to the attachments editor in a manner like the answer provided here: How to add a checkbox element to attachments editor with ...
4
votes
4answers
4k views

Custom Post Types: How-to get rid of editor (-meta box)

I'm questioning how i can get rid of the post-editor (visual + html). I tried to not register post type support, and it still appears (de-registering works fine with every other default meta box on ...
4
votes
4answers
1k views

add meta box - custom field : which to choose?

i've just find out about the custom field, which makes it possible to add something near a post, but what is the difference between "add_meta_box" and "custom field"? Custom field is inside the ...
4
votes
3answers
689 views

Sort posts by custom field numeric value using dropdown

I've read umpteen answers and questions about things that are very similar to this but I just can't get it to work for my specific situation. I have some posts with a category of "property". In ...
4
votes
3answers
1k views

clients list using wordpress

I am using wordpress for my new website and i have list of clients(name and their logos). I am confused how to make those editable using wordpress? Html as follows... <ul> <li><img ...
4
votes
5answers
5k views

Adding Custom Field to Taxonomy Input :Panel

I am looking to achieve something which I figured would be fairly simple to accomplish but it seems there are no real examples available to achieve my needs. Essentially I have a custom post type of ...