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

learn more… | top users | synonyms (2)

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
907 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
906 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 ...
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' => ...
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. ...
0
votes
1answer
88 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" ...
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
708 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
437 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
558 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
719 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
362 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
229 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
620 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
382 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
302 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 ...
0
votes
1answer
476 views

How to show custom field and parent post id in wordpress attachment page (image.php)

I'm trying to use code to show custom field outside the loop in wordpress attachment page (image.php) it's returns nothing. this is the code i'm used to show the custom field: <?php global ...
0
votes
2answers
845 views

Exclude custom post type from search by custom field value?

I've been unable to find anything on how to do this, or if it's even possible. What I want to do is not display results of search in custom post type "resources" on which "resource_usertype" (key) is ...
1
vote
1answer
170 views

Execute js files doesn't seem to work

I have developed a website that uses the "Royal Slider". The post loads custom fields from the database without a problem and loops through the images and create a lovely slideshow as can be seen at ...
-3
votes
2answers
144 views

How can i put a custom field inside this php

Hy, i want to count years of an actor. The date that actor is born is stored in a custom field. $date = get_field('data_nasterii'); Date stored in custom field is : yymmdd How can i stick bouth ...
1
vote
1answer
1k views

Add custom field to all posts in specific category

I want to bulk add a custom field (category) with value (photography) to all posts in a specific category (photography, with Category ID 5). I have used the code below to bulk add a custom field to ...
2
votes
2answers
6k 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 ...
0
votes
2answers
1k views

Create ul list in Custom Meta Box?

I need to create an ul list in a Custom Meta Box. The content/text area of the post is already taken up with other information. Is it possible to create another text area like WP built in one so I ...
2
votes
1answer
1k views

Arrange custom fields with drag and drop?

I am making theme for hotel and i made custom metabox with list of various custom fields that i would need in posts. What i did is i made a list of fields like booking wifienabled coffe pool spa ...
1
vote
1answer
399 views

Getting movie and serial on actor page

I'm building a cinema site, I came with a problem, let me explain: Movies- are stored in Post's Actors- are stored in Post Type - persoane ( taxonomy= lista) Serials - are stored in Post Type - ...
0
votes
1answer
4k views

Run Function if Order Meta Exists - WooCommerce

If a checkbox is checked, it saves a value of 1 for a 'my_checkbox' custom order field in WooCommerce. I'm editing the order admin table and I need to be able to echo a particular icon url if the ...
0
votes
1answer
148 views

$TBA Getting Translated to $0 (Custom Fields)

I'm working on a products showcase website, and in my index I have this snippet of code for my two variables ($price for the price, $buynow for the URL) <div class="buyitnow"> <?php global ...
1
vote
1answer
85 views

Query Posts With Over 1000 Views

The code below is from this link. It basically creates a hit counter, but I'm probably gonna have to do this by IP. How do I make a WP_Query, where only posts up to 1000 views can be seen on the ...
1
vote
1answer
583 views

How do I display a custom field from a custom taxonomy in single.php?

I know that the following mysql query produces the exact results I wish to echo within single.php: SELECT meta_value FROM `wp_taxonomymeta` WHERE `taxonomy_id` =565 AND `meta_key` LIKE 'baseurl' ...
0
votes
1answer
971 views

Textarea type on one field custom add_meta_box?

i got close solution for this question from this link "How to add a textarea to only one of the fields of this custom metabox?", but with different code and he use new metabox, i need to see value on ...
3
votes
1answer
2k views

Auto sort the wp-admin post list by a meta key

I am using this following code in my functions file to hide and add some custom columns to my post-edit screen in wp-admin. I am now trying to get the post list to sort by a post meta field (last ...
2
votes
1answer
4k views

WP Query group/order by category name

I have a requirement for displaying a list of custom post types grouped by category, but in addition to this, each custom post is linked with a meta value (in this example lets say we have a custom ...
0
votes
1answer
3k views

query posts and custom post type with meta key

I'm trying to query all-in-one-event-calendar's custom post type ai1ec_event and normal wordpress posts in a slider on my home page. That works pretty well. Now I want to query only the posts with ...
3
votes
2answers
1k views

How can I save repeatable fields with one value inside an array?

Introduce I am currently working on a slider plugin to learn a lot of PHP and WordPress. I have create some repeatable field with javascript. Some functional details: When the user is clicking on ...
2
votes
1answer
2k 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' ...
3
votes
2answers
164 views

Query meta field using between

I'm trying to Query some lattitude and logitude and then I get some long numbers and apperently the Query dont like that. Let says I have these in the database Meta-key: lat Meta-value: 54.3415000 ...
0
votes
1answer
765 views

How to show animal lineage/pedigree in WordPress?

I need to show the pedigree or lineage of an animal in my wordpress site. Currently I have the animals set up as custom post types, with data inserted using the amazing Advanced Custom Fields plugin. ...
2
votes
1answer
4k views

Filter results with custom field values and dropdown

I need to filter posts by a custom field value. My specific example: User browse to products > category 1 > subcategory A. ALL "subcategory A" items (products custom post type) are displayed as ...
0
votes
1answer
51 views

Custom fields issue [closed]

I installed the plugin Advanced Custom Fields and created few custom fields , but I'm not able to add any content in it. How is this done?
1
vote
1answer
518 views

Facebook social publisher and custom post type fields [closed]

I have a problem with how Facebook plugin shows my WordPress-based posts on my timeline. What basically happens is that the post image isn't shown. Now, the post image I want to show is a custom ...
-1
votes
1answer
314 views

How to get lowest price from custom fields of posts

Here is my Code. It is get sub category from main category. and from sub category having different posts related about different products. Now issue it this that i want lowest price value from ...
1
vote
2answers
3k views

can you set a default value to a custom field

I'm looking to set a default value to a specific custom field, in case the client doesn't add into the custom field it already has a specific number associated with it. one step deeper, I'd like it ...