Custom Fields are fields that can holds arbitrary extra information known as meta-data.
4
votes
3answers
2k 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 ...
6
votes
4answers
13k 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 ...
27
votes
3answers
31k 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 ...
11
votes
1answer
4k views
how to filter post listing (in WP dashboard posts listing) using a custom field (search functionnality)?
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 ...
9
votes
2answers
2k 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 ...
3
votes
4answers
2k 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 ...
2
votes
1answer
427 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
779 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);
...
6
votes
4answers
5k 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 ...
8
votes
2answers
5k 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 ...
11
votes
2answers
5k 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.
8
votes
3answers
2k 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 ...
0
votes
2answers
2k 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:
...
4
votes
1answer
2k 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.
...
0
votes
1answer
76 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
...
10
votes
4answers
12k 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 ...
15
votes
6answers
5k 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 ...
16
votes
4answers
8k 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
4k 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 ...
2
votes
2answers
777 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" => ...
1
vote
1answer
1k 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
1answer
2k 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
1answer
820 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
382 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 ...
0
votes
1answer
599 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 ...
1
vote
1answer
1k 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
50 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 ...
7
votes
3answers
3k 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 ...
5
votes
3answers
3k 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 ...
4
votes
4answers
2k 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
727 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 ...
3
votes
3answers
2k 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
388 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 ...
0
votes
1answer
744 views
ajax jquery update custom field meta value front end
There is probably a much easier way to do this. After much trial and error trying to get a postid from a url, I've opted to add the id to the permalink. However I have no idea how the custom value ...
4
votes
4answers
3k 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 ...
2
votes
2answers
534 views
Displaying additional User Contact Information
I have been advised how to add additional contact info fields to the User admin area here (Click here).
However, I am not entirely sure how I can display the the field contents in a link within my ...
2
votes
4answers
1k views
meta_query for keys that aren't yet set
I'm trying to query for a custom post type for a gallery system. I have a checkbox to set a gallery as a "featured" gallery (set up through More Fields plugin) - if this is checked then the meta value ...
2
votes
2answers
4k views
How to activate “custom fields” section in WP3
This is probably a stupid question, but I am setting up a finnish Wordpress installation. The "custom fields" section in the "write post" section is gone; I gather it is hidden by default.
That is a ...
1
vote
1answer
308 views
Use ajax to update_post_meta
2 days ago I asked this then I tried to work on my code to be able to understand how ajax and php work and now I have a new issue that, probably would be easily solved.
These are my codes:
<?php
...
1
vote
2answers
410 views
How To Create a Meta Box with Html Content with Instructions to Site Editors When Editing a Post or Page?
I would like to add a custom Meta Box with Html content in the screens New and Edit Posts/Pages (/wp-admin/post.php?post=POST_ID&action=edit), so that I could display a list of editorial ...
0
votes
1answer
308 views
Custom Query: query by post custom meta data
So I have a custom post called event, but I need to query only those posts which have a custom metabox(is a checkbox) called `Show On The Homepage: and only if that checkbox is checked.
<?php
...
0
votes
3answers
2k views
Prevent duplicate posts in wp_insert_post using custom fields
My source links are something linke this :
http://sample.com/entertainment/default.aspx?tabid=2305&conid=102950
http://sample.com/entertainment/default.aspx?tabid=2418&conid=104330
...
-1
votes
2answers
541 views
Integrating WordPress Content into a jQuery Slider
I have a pretty basic 'featured-list - image slider' implemented above my content in my custom WordPress theme. How do I integrate WordPress content into the slider so that the slide content is pulled ...
2
votes
1answer
124 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 ...
2
votes
2answers
202 views
Only show metabox when date-value in other metabox is over?
probably a weird question.
I'm using the custom MetaBox and CustomFields Class by jaredatch on Github.
I have this "event-date" metabox:
$meta_boxes[] = array(
'id' => ...
1
vote
3answers
2k 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 ...
1
vote
2answers
980 views
How can I remove fields in the attachment editor?
Is it possible to remove a default attachment field from the attachment editor, for example the "Caption" field ?
To give you some context, I'm trying to build a custom attachment editor page. I ...
-1
votes
1answer
117 views
How can I attach files without using a plugin?
I want to add files from my site or from external links with files to any of my posts, and be able to add the size of the file and choose which ones it will do "File Force" and which not. I want to ...
3
votes
1answer
2k views
Custom Taxonomy Template Post List with Sort Order
I have an interesting problem I am trying to solve. Here is my situations:
I have create a custom post type for "events".
For each event post I require custom fields to be entered for the event ...
3
votes
3answers
4k views
I want to have my custom field use HTML, how do I do that?
I want to have my custom field use HTML, how do I do that in such a way that I can use a rich text editor to view the content?