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

learn more… | top users | synonyms (2)

2
votes
4answers
1k views

Custom field values repeating

I'm at a loss. I've got a custom meta box with the 'multicheck' code that Jan created. It's working great. My issue now is getting the data to return properly. Scenario: there are 5 possible values, ...
2
votes
3answers
9k views

How to use query_posts() with a date filter on a custom field?

I have defined a custom post type that uses a meta field to store dates. In my functions.php I have the following code which saves the start date. The format of the date that is sent in the startdate ...
2
votes
2answers
162 views

Custom field losing p tags on display

I have a Custom Post Type that has several custom fields. One of the fields is multi-line and includes text with p tags. When I view this field in the visual editor the p tags are all there. I ...
2
votes
3answers
1k views

Advanced Custom Fields - Get custom fields from parent page

I'm using Advanced Custom Fields making it easier for my client to manage his content. On all of my child- and parent pages i would like to have the same header image and sidebar information. ...
2
votes
2answers
660 views

Show posts on a Google Map

Through the custom fields, I assigned to each post its geographic coordinates (latitude/longitude). Now, I'd like to show a Google Maps with a marker for each post. Do you have any suggestions on ...
2
votes
3answers
2k views

Add input field to 'Pages > Edit Page' through functions.php

Original Question: I'm trying to add an input field to 'Pages > Edit Page'. The use of this input field will be for a user to add an ID of a slider, so that that slider will be page specific. ...
2
votes
2answers
757 views

Multiple custom fields with the same name

Is it possible to have several custom fields with the same name? For example, I have a custom field called "promotion" for a CPT called "event". Sometimes there are more than one promotion applied ...
2
votes
1answer
927 views

Saving Custom Field in Attachment Window in WordPress 3.5

I'm using the code below to add a custom text field in WP 3.5 Attachment Window (from this question # Expanding new Media Uploader in WordPress 3.5) ... add_filter( 'attachment_fields_to_edit', ...
2
votes
1answer
2k views

Add custom fields when specific templates are selected

I'm trying to make change to a site where with the current infrastructure isn't great as due to how it's been built over the previous site rather then fresh. I have a section of the site which needs ...
2
votes
2answers
590 views

Is it possible to order posts by two meta values?

Hopefully this is a reasonably straightforward question! Is it possible to order posts, on the front-end of my WP install, by two meta values? I have a meta key called genus and another called ...
2
votes
1answer
633 views

Many to Many Relationship between Two Custom Post Types

How to I create a many-to-many relationship between two custom post types? Give type A and type B, I'd like to be able to show all B's that relate to a given A, and all A's that relate to a given B. ...
2
votes
2answers
3k views

Edit Custom Database Tables in Wordpress

I have a site that uses custom database tables to manage info that is inserted by a process completely independent from Wordpress. The data from the table is used in the Wordpress site but it is not ...
2
votes
2answers
3k views

How do I add media to a custom post type?

I want to add some custom fields to allow a user to select items from the Media library for the custom post (in the add/edit view) Is there a way to do this?
2
votes
1answer
1k views

custom field value date convert to unix timestamp problems

For some reason, I'm having difficulty converting a date value stored in a meta field to a unix timestamp (and back again). If I save the date as a string it all works fine, but if I convert it to a ...
2
votes
2answers
1k views

How to change what the post creation page looks like?

Is there a way (plugin, or something else) to set it where there is a drop down on the "New Post" page that allows you to choose a post type and the fields change allowing you to filter what content ...
2
votes
4answers
208 views

Multiple information using custom post type

I made a new custom type, it's working fine. My question is: If i want to add in a single post that custom-type with different informations for about x times...how should I do this? Example: Let's ...
2
votes
1answer
693 views

Advice needed for importing custom field data and database structure

Looking for advice for the best method to accomplish the following. I have a custom page template with several custom fields/taxonomy. The data needed for these custom fields actually resides in ...
2
votes
1answer
180 views

Custom Field sort not working (WP 3.8.1)

I am trying to sort a custom wp_query using the date format YYYYMMDD (php: date('Ymd') ). This will not be regarded as date field, but rather as a numeric one stored in custom field. My WP-QUERY code ...
2
votes
1answer
162 views

Automatically assign taxonomy term if custom meta value exists

I currently have a custom meta field for adding a video url to the post. I'd like for the existing taxonomy term "video" to be automatically assigned to the post upon saving if the meta field has any ...
2
votes
1answer
201 views

Add description text under input field for new profile fields

How can I modify my following code to add some description text under the input fields? I tried modifying it as you can see with the facebook url field but the text shows up under the field label and ...
2
votes
1answer
80 views

Why is unfiltered html allowed in custom fields for author / contributor roles?

I'm creating a WordPress theme which has a custom textarea metabox for inserting embed codes (soundcloud, bandcamp etc). I feel like I should be adding in some security to stop non-admin/editor users ...
2
votes
3answers
44 views

Custom fields: In what order are they saved into the DB?

If I insert multiple custom fields to my article, they get sorted in "I don't know what" way. So when I insert some multiple fields in an article and call those via $cf = get_post_custom(); foreach ...
2
votes
3answers
373 views

Function to change meta value in database for each post

I have a meta key called 'prijs' in each post. The value of this meta key consist of numbers in the follow structure: 2,100.00 I want to remove the comma in the meta value to get this output: 2100.00 ...
2
votes
2answers
3k 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 ...
2
votes
1answer
1k views

Advanced Custom Fields query

I have, hopefully easy question. I have my query here, which is using ACF <?php query_posts(array('post_type' => 'our-clients-list', 'posts_per_page' => 1, 'order' => 'DSC', 'orderby' ...
2
votes
1answer
141 views

Adding a custom field or metabox to the post-thumbnail widget?

Is it possible to add a custom field to an existing "widget" in the backend? What I wanna do is provide a way to have a checkbox to apply a thumbnail that is double the size of the normal one on the ...
2
votes
1answer
257 views

WP doesn't show Array Custom Fields?

I'm wondering why WordPress doesn't list PHP array() and any serialized data in Custom Fields in Admin Panel (for Pages, Posts etc.)? Only Custom Fields containing strings and numbers show up and can ...
2
votes
1answer
3k views

Multiple orderby values in WP_Query

I'm trying to come up with a query to sort by multiple orderby values. Here's what I have so far: $dept_id=2; $query=new WP_Query(array( 'post_type'=>'wpcontactus', ...
2
votes
1answer
2k views

passing argument to get_template_part() or a better way to code

I have this include … event-list.php <?php /** * The loop that displays upcoming events */ ?> <ul class="event-items"> <?php $yesterday = time() - 24*60*60; $args = array( ...
2
votes
2answers
711 views

Adding meta values to permalink

I have publications and I want to simply add year and month to the permalink. Currently the year and month of publication is added to the post as a meta value. I've set up publications as a custom ...
2
votes
1answer
255 views

Create meta boxes that don't show in custom fields

I used the code below to create a metabox for posts. These meta boxes are also seen in the custom fields. I do not want these meta boxes to show in custom fields. Is there any way to not show meta ...
2
votes
1answer
473 views

How to prevent custom fields from being cleared during a bulk edit?

In my function for saving custom field values I add a few checks to prevent the values from being cleared during an autosave or a quick edit. add_action('save_post', 'save_my_post'); function ...
2
votes
1answer
448 views

Meta keywords and descriptions plugin for manually editing meta for each page/post

Can anyone recommend a simple plugin that allows me to add/edit meta tags for keywords and description on each page of my wordpress site? Just something that adds the fields to the page editor would ...
2
votes
2answers
1k views

Auto-add paragraphs to custom field?

hey guys, is it possible to format text in a custom field input box automatically with paragraphs? e.g. like the normal text-widget that has the option to say "auto-add paragraphs" when there is a ...
2
votes
4answers
2k views

Automatically Insert Custom Field on Custom Post Type Publish

I was searching for a way to automatically insert a custom field when publishing a custom post type. And I repeatedly found the same solution, from here: ...
2
votes
2answers
1k views

Correct Approach for Validating Custom Field Input

I have a custom post type with several custom fields. I am looking to do some validation on these fields because they will be used downstream by other services. So, it is important that it can't be ...
2
votes
1answer
157 views

Custom Meta Field - Youtube embed

I created a custom meta field and I want to use it to embed a youtube video into the post. It works but when I post a code like this: <iframe width="640" height="360" ...
2
votes
1answer
79 views

How WordPress autosave can save plugin fields?

Setup: WordPress Add/Edit Post/Page A plugin that have its own postbox with several hidden fields. Issue: How these custom hidden fields can be saved along with the other post data within the ...
2
votes
1answer
200 views

How to initialize PODS?

I downloaded the PODS 2 plugin (amazing!) - added a field to existing content type and now I would like to print it using php inside a widget. However I am not sure how to print the fields using pods ...
2
votes
1answer
1k views

WP_query : meta_key with custom rule for specific value

I'm a bit stuck with a WP_Query code. Here it is : $args = array( 'post_type' => 'post', 'meta_query'=> array( 'key' => 'karma', 'compare' => '>=', ...
2
votes
1answer
81 views

How to save multiple metaboxes?

I read a tutorial about metaboxes, most of things are clear but I have a question about multiple metaboxes. My question is about saving, in the tutorial: <?php add_action( 'save_post', ...
2
votes
1answer
289 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
1answer
3k views

How to create Repeater fields using Advanced Custom Fields?

I'm using Advanced Custom Fields and trying to create a field with the field type Repeater. But the problem is that the Repeater option doesn't appear in the select list with the field types. I can't ...
2
votes
1answer
903 views

Get multiple custom field values in a $wpdb query [duplicate]

Possible Duplicate: How to query posts based on lat-lng coordinate as post meta? I want to create a $wpdb query that select the closest places (custom post type) near the current ...
2
votes
1answer
3k views

Can I query custom meta data through WP_Query

Ok, my question is a bit complex so I will try and give a general explanation and then go into details afterward. I am running WordPress 3.4.2 and I am using WCK Post Type Creator and WCK Custom ...
2
votes
1answer
377 views

Custom text-only header

I am developing a WordPress theme and would like to make use of a custom header on a the homepage (I'm using a custom page template). I would like this header to not include an image, but rather an ...
2
votes
1answer
166 views

how to save multiple custom fields for a post in one go?

I want to save multiple custom fields for a custom post in one go. Something like get_post_custom() except for that I need to set it this time.
2
votes
1answer
4k views

Custom Meta Field not Working with qTranslate

I am running the newest WordPress and qTranslate. I have made a page that enables some custom fields that are working ok. qTranslate enables languages like tabs when editing a page. But this ...
2
votes
2answers
382 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' => ...
2
votes
2answers
5k views

Show values of custom field created with ACF on a page

Im using ACF to create custom fields. One of them is a list of checkboxes that display some options (option1, option2, option3....). and what i need is to show these options on a page in a list like ...