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

learn more… | top users | synonyms (2)

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 ...
36
votes
3answers
49k 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 ...
12
votes
4answers
22k 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 ...
5
votes
4answers
5k 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 ...
3
votes
1answer
705 views

Truncating custom fields

I'm using custom fields to pull a secondary description. I'd like to use the built in WordPress truncate but can't seem to figure it out. $desc = get_post_meta($post->ID, "youtube-desc", true); ...
2
votes
1answer
1k views

Check before publishing, if already exist post with current custom field value

I have a custom post type with only 3 custom fields in it. $post_types = get_post_meta($post->ID,'post_types',true); $post_taxonomies = get_post_meta($post->ID,'post_taxonomies',true); ...
18
votes
1answer
9k 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 ...
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 ...
14
votes
5answers
13k 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 ...
4
votes
1answer
515 views

What is the index [0] for on post meta fields?

Trying to improve my PHP knowledge through test and try! I am confused on [0] arguments at following WordPress PHP code global $post; $custom = get_post_custom($post->ID); $price = ...
17
votes
4answers
31k 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 ...
23
votes
2answers
11k 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.
7
votes
1answer
10k 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!
1
vote
2answers
5k views

User Profile / Add Custom Fields

Hello: I am trying to add 7 custom fields to the standard Wordpress wp-admin/profile.php page. There are a few site which suggest a simple bit of code to do this, for example: ...
0
votes
1answer
2k views

2 orderby in wp_query with 2 custom fields

I'm triyng to display hotels (taxonomy which i have created) by two 'orderby' with wp_query but i'm not success. Results looks likes: Hotel 1 : 2 persons 5 stars Hotel 2 : 2 ...
0
votes
1answer
1k views

Custom query with category exclusion and post-meta “whitelist”

I have two widgets, one shows News while the other shows everything except News (We'll call the second one Blog). The blog portion is currently working correctly. The News posts are either ...
0
votes
1answer
917 views

Order by custom field date?

I've created a category "Expire Soon" and i want to insert and sort the posts by custom field "expiration_date". I use this code but the posts are sorted by custom field "expiration_date" but not by ...
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
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 ...
2
votes
2answers
4k views

Add a checkbox to post screen that adds a class to the title

I'm needing some posts to have different title colors than others, and I figured this would be most conveniently accomplished by some sort of check box on the post creation/edit screen. How would I go ...
4
votes
1answer
4k views

Creating Photo Gallery System with Custom Post Type

I'm creating a movie blog using WordPress. I have Movie and Trailer custom post types and I want to add a Photo feature for this and I want to add a relationship between this photos and Movie CPT. ...
1
vote
1answer
2k views

Order get_terms() By Custom Field

I want to order my categories like I order my pages. I've added an extra field called Order to my taxonomy, but how do I order my terms by this value? Adding and Saving my Order Value: /** Add New ...
0
votes
1answer
279 views

Update Wordpress Custom Field with AJAX on cached page

I'm new to ajax am trying to create a simple hit counter that updates a custom field in Wordpress after the page loads. The page is cached, so any attempts to use PHP alone will not work. I'd like ...
0
votes
1answer
142 views

How can i get the actor birthday by date?

How can i retrive the actor birthday by Date. How i add the date, i have a custom field with Calendar. Now is 20th ... how can i retrive the Actor By this day I try this but it wont work ...
20
votes
6answers
11k 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 ...
8
votes
3answers
7k 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 ...
18
votes
5answers
14k 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 ...
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 ...
5
votes
2answers
2k views

How to add a checkbox element to attachments editor with example

The code below adds a custom input field to the attachments editor. How can I convert the text input to a checkbox and get/set the value of the checkbox on load and save? Note: "input" => ...
2
votes
1answer
2k views

I am trying to create a simple frontend form for posting

i am trying to learn and create some deeper things with Wordpress. My goal is to create a code/script/plugin that will allow me to post from the frontend. I have seen many plugins, like templatic ...
3
votes
3answers
3k views

Add new “Insert Into Post” button with another function

Problem: Add a hook that automatically adds a short tag to video attachments when inserted from the Media Library (video) tab: Update: This works under the 'Media Library' tab — and doesn't break ...
1
vote
1answer
1k views

Use WP 3.1 Internal Linking 'widget' as a meta_box

There is lots of information out there on how to customize meta boxes added with add_meta_box(), such as enabling WYSIWYG editors on textareas and uploading images. What I have yet to find is a way ...
3
votes
5answers
575 views

How to do a custom bookmarks post type?

Let me first explain what I am wanting to do... I am wanting to add all my hundreds of website bookmarks that I have now in my browser, into wordpress for the following reasons. Can search my ...
2
votes
2answers
62 views

Custom post meta field effect on the performance on the post

I have the posts which have many custom defined meta fields. On posts I am calling them on requirement using get_post_meta. Means for 10 meta fields I am using it 10 times. Am I doing it right? ...
0
votes
1answer
1k views

Display thumbnail from custom field

I have a custom field called picture. On the media settings page I've set thumbnail size to 100x100. If upload an image called gecko.jpg, Wordpress automatically resizes it and generates ...
2
votes
1answer
328 views

How to add dynamically the main parent pages's custom fields and their values to all sub-pages?

I have a main parent page with multiple sub-pages. The main parent page has some custom fields (meta boxes?) with specific values. My intent is to add dynamically these custom fields and their values ...
1
vote
2answers
1k views

Rewrite custom post type url's adding meta box values

I've got these custom post types (CPT) and meta boxes: Movies (CPT) Genre (Meta box) Genres (CPT) If one movie is called Die hard then I want the permalink to be: /genres/action/die-hard This ...
1
vote
2answers
154 views

List upcoming events, ordered by date in a custom field

I want to display a list of events with dates in upcoming order. Ex: 23 March, 2013, 30 March, 2013 Below is the query I'm using to filter out posts from my database: query_posts( ...
1
vote
1answer
3k views

Custom Meta Boxes: Store two values in one repeatable field

I am trying to create a custom meta box where the user can add fields as needed. I followed this tutorial: http://wp.tutsplus.com/tutorials/reusable-custom-meta-boxes-part-1-intro-and-basic-fields/ I ...
0
votes
1answer
225 views

How to reload the role specific registration form on validation errors?

I test a solution for separate registration for different roles and it works very well. But the validation part/function (see bellow) on errors reloads/reuse the generic registration link and not the ...
7
votes
4answers
3k 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 ...
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 ...
2
votes
2answers
4k views

Populating meta box with select-list of existing posts, and assigning it to custom post types

My question is partly based on this answer: http://wordpress.stackexchange.com/a/5778/27135 Mike's answer is really great, and the solution worked fine until I needed to include my meta box in a ...
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 ...
4
votes
2answers
1k views

Using media-upload.php to upload mp3 via custom fields

I'm trying to use the Thickbox file upload dialogue with a custom field to allow the user to upload an mp3. What I want to do is to grab the URL of the uploaded mp3 and save it as postmeta (saving the ...
5
votes
6answers
5k views

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

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: ...
4
votes
4answers
6k views

Add custom taxonomy fields when creating a new taxonomy

I've been able to leverage this super tutorial by @Bainternet in order to add custom fields for taxonomies. I've tweaked the markup, and added a separate callback to add fields to the "Add New ...
4
votes
3answers
13k 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 ...
2
votes
1answer
1k views

How to sort CPT by custom meta value (date), and return posts month by month

For future reference: I am using the great Meta Box Plugin to help expedite meta box creation for my custom post types. My goal: To build a highly customizable events section closely resembling a ...
1
vote
1answer
1k views

Custom bulk action for media gallery items

I'm trying to add custom "Bulk Actions" to WP 3.5 new media gallery items. I started from this excellent tutorial which does exactly what I need, but with regular posts; so i tried to adapt it to work ...