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

learn more… | top users | synonyms (2)

1
vote
1answer
62 views

Migrating old posts to new wp, how to extrapolate infos from the post body to custom fields?

I need to migrate some information that are store in the post body (like "price:200$"), extrapolate them somehow and put them into custom fields. how do I do that? The blog is about restaurants and ...
1
vote
2answers
182 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( '...
0
votes
1answer
174 views

Calling a custom profile field only it it exists

I've used this code to show custom fields if they're filled in a post using Custom Field Suite Plugin <?php if($cfs->get('whatliked')){?> <?php echo $cfs->get('whatliked'); ?> <?...
1
vote
2answers
1k views

How to remove slug metabox from custom post type's page?

I just discovered a new meta field on the newly created custom post type page. The meta name is slug, and it's under the wp editor field. What's that, and how can I remove it?
0
votes
1answer
980 views

Retrieving custom field value with get_post?

There's no mention of custom fields values in Get_post's codex page. Is it impossible to use get_post to get a custom field value of some post, and if so, is it necessary to perform a whole loop just ...
3
votes
1answer
2k views

Formatting custom meta box date from YYYY/MM/DD to a more readable alternative

QUESTION This is following a previous question that was graciously answered by Milo earlier here - How to sort CPT by custom meta value (date), and return posts month by month In short, I'm having ...
0
votes
1answer
126 views

Add a class to post_class if more than one post shares same meta_value_num

I would like to be able to add a class such as .samedate to posts that share the same meta_value_num from a custom meta box. So for example: Say two posts share the same custom meta box value for a ...
0
votes
2answers
708 views

How to exclude custom fields from search queries?

I'm building a hotel search engine and I've first created a custom content type "hotel" with Types & Views Toolset. I'm using "Search everything" plugin to query custom fields and custom taxonomy ...
0
votes
1answer
102 views

Sorting posts by custom field value in array

I have a custom field value that is an array and it has date as one of the values: a:3:{s:4:"date";s:10:"03/06/2013";s:6:"target";d:1000;s:8:"currency";s:3:"USD";} I'm trying to sort posts with ...
0
votes
1answer
133 views

Display Custom Field in Sidebar if Value is Present

I'm trying to use 'if' 'else' to display a link button if I have a value in the 'TourURL' custom field, and if not, nothing will display but can't seem to get the if code to work: <?php if(global $...
1
vote
1answer
643 views

Custom Metabox Not Saving

I've simplified a problem of saving custom metaboxes on update and still can't get the box to save the custom-field input to the database. This is the call from functions.php to an external file /...
0
votes
1answer
372 views

Sort categories by meta value

How can I make a list of categories with 4 last posts in each where every category is sorted by meta_value. For example, template without sorting by meta_value is http://pastebin.com/AeH6vx9b It ...
0
votes
1answer
813 views

How to store post meta in an array

I am creating a plugin, where the user can create forms with an unlimited amount of fields. I would like to store each field the user creates as an array in a post meta field. What would the code look ...
0
votes
1answer
140 views

Add Custom Fields After Page Title

I want to add my custom fields after the page title when you view it on the site. How do I do this? PAGE TITLE [CUSTOM FIELDS HERE] PAGE CONTENT
0
votes
2answers
311 views

Custom Theme Fields in Settings Menu - apply filters to one of those fields?

I found an interesting concepts of adding an additional option to the "General Options" in Wordpress. /** * Custom Theme Settings * see http://digwp.com/2009/09/global-custom-fields-take-two/ */ ...
0
votes
2answers
918 views

Any way to include custom fields in WP_Query results?

Looking for a way to include custom fields in the output of WP_Query. I am managing a site where nearly every post type has a lot of custom fields defined and it would be much nicer not to have to run ...
0
votes
1answer
409 views

Custom fields: dropdown values depending on other custom field value

i have custom fields like this: "country" - values: "USA", "Russia", "China" "city" - values: "Chicago", "Moscow", "Beijing" I want when user in custom field "country" choose value "USA" after ...
0
votes
1answer
106 views

KEY and VALUE custom field issue

I have this bit of code for displaying the value of links key of my custom fields. $links = get_post_meta($post->ID, 'links', false); foreach($links as $link) echo '<div class="first-link ...
0
votes
1answer
101 views

RSS Feed in Custom Field

I have a custom field intended for a rss feed. It is simpley a URL in the field, how do I take that url entered and output it into the correct section in the template? <?php include_once(ABSPATH . ...
0
votes
1answer
442 views

How to echo a different field if another field is empty?

I succeeded in getting both images and video to echo into a bootstrap carousel. However, I run into a problem when the post contains no images. If there are no images then there is no class="item ...
0
votes
1answer
110 views

Custom fields with square brackets in the name

I have some custom fields which I need to have square brackets inside. This would not be a problem apart from the fact that I need the end user to be able to reselect the custom field on another post ...
1
vote
1answer
2k 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 ...
0
votes
1answer
1k views

Calling custom profile fields?

I've hidden and created various profile fields using the following code: function my_user_contactmethods($user_contactmethods) { // You can get rid of ones you don't want unset($user_contactmethods['...
1
vote
1answer
1k views

WP_Query orderby not working with meta_value_num and menu_order

I have made a custom post type (sidebar_element) which are shown on sidebar. On each sidebar element admin can choose where in sidebar should that element be shown, ie. 'top', 'middle' or 'bottom', ...
0
votes
4answers
942 views

Add additional field to custom post_type

I am trying to add another field (subtitle) to my already created and existing custom post_type: team (code from functions.php in my *child*theme) <?php /** * Custom Post type register framework ...
2
votes
1answer
362 views

Better post meta efficiency?

I work with websites which require using Post Meta for Post Objects within a particular Post Type. I often add a Meta Box to a particular Post Type, to provide additional settings for the new Post ...
1
vote
1answer
2k views

How can i create a function to get youtube video time

Tom J Nowell posted this code to help me retrieve the YouTube video time. Functions // function to parse the code from the URL function parse_youtube_video_id_from_url( $video_url ) { $...
2
votes
3answers
919 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 ...
3
votes
2answers
919 views

Save HTML formatted data to post meta using add_post_meta()

Array ( [post] => Array ( [jw_objective] => Exposure to e<b>nd to end development</b> of various applications; right from requirement analysis to system study,...
0
votes
1answer
49 views

How to insert post into a page?

i created a custom_post_type: add_action('init', 'event_register'); function event_register() { $labels = array( 'name' => _x('Pacotes', 'post type general name'), 'singular_name' => _x('...
0
votes
2answers
2k views

Excerpt length: get first paragraph

I'm trying to figure out if it's possible to get an excerpt from each post, grabbing the first paragraph from each one. I'm currently using the ACF plugin and have custom post types and custom fields. ...
0
votes
1answer
105 views

custom header text

I am creating a custom website by modifying the twenty-eleven theme. I want to create custom text in the header area that is unique to each page. Is there a way to add a 'description' to each page and ...
0
votes
2answers
1k views

get_post_custom_values not working

I have made a custom template to show the posts in "Products" category in a single page.I have some custom fields.I need to show the values of the custom fields in the page. I have used the ...
0
votes
1answer
1k views

Importing from XML is ignoring serialized custom field

I have been trying to import something into a custom field using the WordPress Import tool but it seems to be leaving the custom field empty in the database. <wp:meta_value><![CDATA[a:19:{s:...
0
votes
1answer
90 views

Footnotes in custom fields

I am using Jquery Hover Footnotes plugin that allows adding footnotes and dynamically displays them on hover-over. In other words, I use {{FOOTNOTE_NUMBER}}, Then I embrace the actual footnote text ...
0
votes
4answers
100 views

Cannot Hide Google Map if custom field is blank

I am using the following to display google maps using hotel_address custom field. <iframe width="440" height="400" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps....
2
votes
1answer
2k 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
709 views

How to add a new meta key and assign timestamp to posts

I've been trying to look for a way to create a loop in my website and show posts being read/watched but have not found anything. The only way I can accomplish this would be to create a new meta key (...
-1
votes
1answer
440 views

Query posts by Custom Meta (checkbox) & Genesis Grid Loop

I've been trying tons of things for the last 2 days. I'm at a standstill now. I read a ton of posts here but nothing has worked yet. I have a CPT 'artists'. This CPT contains a custom field ...
0
votes
2answers
132 views

Custom fields driven site. I want to make a visual editor driven page template. How?

My company had a website developed that is entirely driven by custom fields. We're now discovering that we didn't anticipate the need for pages with custom layouts, the kinds that can be made on case ...
0
votes
2answers
123 views

Targeting categories in custom fields

I was hoping somebody could help me out with custom fields. I created a custom post type called game-type in WordPress. In this I have the categories "Android", "iOS" and "PC", then within these I ...
0
votes
1answer
567 views

Custom metabox not working

Morning! I have a call in my functions.php file to include a custom meta-box php file in my theme's directory called: /metaboxes/home-meta.php The code is as follows for the call: add_action( '...
0
votes
2answers
2k views

How to load php file for specific page in admin?

Hello and thanks for the guidance! Trying to load a custom .php file for only my home page (template is page-home.php) by using this code: add_action('admin_init','load_home_meta'); function ...
3
votes
2answers
727 views

checkbox in post add/edit to add/remove the post from menu

Introduction: I have created several post type for my theme. To display a post from a post-type I need to go in appearance/menu and then add the post manually. My Goal: I want to add two radio ...
0
votes
1answer
371 views

How do i get a specific user metadata using custom metavalue outside of wordpress?

I need help. I need to get a user ID or email (email is can do but ID is better) based on their phone number, outside of WordPress. I already have their phone number in a variable and billing_phone ...
0
votes
1answer
231 views

A meta box (in a custom post type) with two different type of fields

I want to make a meta box (in a custom post type) with two different type of fields: Text and select, (maybe put it in array ?) and display this meta box with this two fields with a single ID ...
2
votes
1answer
636 views

order by meta_value serialized array

Hi I'm trying to pull posts using the wp query. Just one problem--I am trying to sort the posts alphabetically by a certain meta_value. Thing is that this meta_value is a serialized array. Is there an ...
1
vote
1answer
2k views

Checkboxes in registration form

I want to use checkboxes on registration form, but values are not storing in the profile page. here is the code on functions.php <?php add_action( 'show_user_profile', '...
1
vote
0answers
389 views

$form_fields from attachment_fields_to_edit returning empty array

I'm trying to remove the caption field from non-images attachments' edit page, which should be a simple matter of unset($post['post_excerpt']), but I can't unset a non-existent value... Looking at ...
1
vote
1answer
304 views

Better Method for Multiple Meta Boxes

I'm learning about meta boxes and have gotten them to appear on my local dev, but I can't figure out how to avoid creating new functions for saving multiple meta boxes. I assume that I could call an ...