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

learn more… | top users | synonyms (2)

0
votes
2answers
191 views

Guest Author - How to modify my custom function code if the guest author URL will follow a particular pattern/format?

Based on code the awesome G.M. provided in an earlier question (Use Custom Fields to Create Guest Author Link), I now have a custom function that uses custom fields to support guest authors. The code ...
0
votes
0answers
54 views

Post order by custom field

I have added a custom order option in woocommerce to sort products based on a custom field (number). The following code works for products with assigned custom field. My issue is that the products ...
0
votes
3answers
3k views

converting custom field date format

I am using the More Fields plugin which gives me the ability to create a date formatted YYYY/mm/dd and I want to convert that to be shown like: February 11, 2011 Is this possible?
0
votes
1answer
19 views

Way To Store Global Meta Values

When using posts there is a way to store meta values on a per post level. Is there a way to store values on a global site value? I want to save a numeric value that isnt tied to any single post. I ...
-1
votes
1answer
26 views

How to make a customized user registration form using the built in wp-register() template tag

I want to make a registration form in WordPress, but i need it to contain my own custom input fields. For instance, i need it to have an input field such as COUNTRY, SCHOOL, COURSE, ...
0
votes
1answer
29 views

Custom post type name and assigning custom taxonomy

I've made mistake creating custom post type. I've put: register_post_type( 'Post Name', $args ); instead of register_post_type( 'post_name', $args ); Now I need to assign new custom taxonomy to ...
0
votes
1answer
44 views

Edit custom fields in posts list

Is it possible to edit (or add) custom fields directly in posts list (/wp-admin/edit.php)? I need to do it quickly for many posts (1000s) so editing every and each of them would take ages to ...
1
vote
1answer
54 views

Query all posts if multiple meta key don't exist

I'm trying to get all posts that don't have a meta ket that starts with aa_. I can do it this way $args = array( 'posts_per_page' => -1, 'category__in' => 23, 'meta_query' => array( ...
0
votes
2answers
3k views

Filtering a WP_Query meta_query by numeric values isn't working

That was a very dense title. I have a custom post type "event" which has a Date/Time picker field "event_date" thanks to the Advanced Custom Fields plugin. This Date/Time picker saves a UNIX ...
0
votes
0answers
21 views

Add custom field for users

I am using Metabox for a while and is a great plugin but I was using in pages and posts. Now I want to add a simple checkbox to users profile page, is that possible with Metabox plugin? Can any ...
1
vote
0answers
107 views

woocommerce in check out page how change the tax rate with ajax an php [closed]

Hi can anyone please tell if possible change the tax rate in woocommerce plugin in chekcout page i want to change the rate tax 0% or 19% when user select option if personal(19 %) if company (0 %) ...
0
votes
1answer
49 views
1
vote
1answer
122 views

How to add tab which is visible only in admin side of product in woocommerce? [closed]

I am new in wordpress development. I want to do add settings in a product page in a new tab. How to I add settings code That I tried to add Tab //add product tab link in admin ...
0
votes
0answers
8 views

Book-like index on a page with foreach custom field and array merge

I'm trying to make a page with a Table of Contents in which my 'lyric' posts need to be ordered by three different custom fields. Basically each song could either be Original or about a Game, and in ...
0
votes
1answer
186 views

Turn raw url into clickable links

I have a custom field that contains a bunch of urls in it. I want them to be clickable links in that custom field only. How can I do this? I could just manually convert them to html links but that's ...
-1
votes
1answer
24 views

Show or hide custom fields by user's role [frontend]

Is it possible to hide or show custom fields by user's role. For example: I have custom field "wholesale_notice" and it have to be visible only for my "wholesale" user role. Thanks
-2
votes
1answer
167 views

woocommerce how in checkout to add my custom field check box, and when i check it hide the shipping adress and add tax 19% [closed]

Hi i working in page with virtual product i need to do this so this i want to do i want to have a checkbox with name "Personal" so when click hide right way the company name adress etc also i want ...
0
votes
2answers
1k views

get_post_custom single array

Is there a way to return single values only when I run get_post_custom($post_id); it seems that I'm receiving double array, even when there only one value for this meta_key
0
votes
2answers
50 views

Custom post types, disable fields

I have a plugin that is syncing data from a third party service into a custom post type. The idea is that the post type acts as a slave to the third party service, so any changes there overwrite any ...
0
votes
2answers
44 views

If value present, order posts by two consecutive custom fields

Basically on my site I have a bunch of song lyrics and in a static page I want to show them listed by album Link to my website and album position of the song and I have two custom fields with that ...
0
votes
0answers
19 views

Making Custom Admin Columns Editable

I have a Custom Post Type called 'team'. This CPT has numerous Custom Fields (created using the Advanced Custom Field plugin) of which one is 'day'. I understand that in order to get the 'day' value ...
0
votes
0answers
14 views

Category page ordered by custom fields with IF conditions

on my site I need to sort posts by a custom field when shown in category pages like this one, but my problem is that I kinda need to do it like this: -if post of the "lyrics" type has the field ...
0
votes
2answers
39 views

Custom field picture instead of post thumbnail on category page

I'm trying to modify a theme to make it work with my custom fields (I'm using ACF for most of the data I put on pages) for a site with song lyrics on it. The original code was this: ...
0
votes
0answers
42 views

Sort search results by meta_key value

I really need help with this. Below is a code of my template for search results page search.php and everything works just fine. Now, the website is about public events so it's very important that ...
0
votes
1answer
49 views

Advanced Custom Fields from Category - IF statement

Please if someone could help ill be very greatful. I know how to use the if statement using Advanced Custom Fields on posts - but this time I want to pull the value from the Advanced Custom Fields in ...
0
votes
2answers
683 views

Setting a custom $query->query_vars['meta_key'] breaks the WordPress menu

First of all, my problem is very similar to this one: http://stackoverflow.com/questions/10629245/wordpress-menu-disappears-when-query-query-varsmeta-key-is-set However, the answer accepted for this ...
1
vote
1answer
106 views

Passing Variable as URL Parameter — Security concerns?

I need to make sure I'm not opening up a security hole in my site. I have a Custom Post Type called "Communities" and a custom post type called "Floor Plans" and need to add a parameter to the URL on ...
0
votes
0answers
33 views

How to retrieve referrer tag, and save in custom fields for each WC order?

I need to save the traffic source of each order for my Woocommerce store because I need to know what internal page or external website had resulted in that order. I'll need this for customer service ...
0
votes
0answers
89 views

Woocommerce: Custom Price Calculation in Variation based on number of pages per book

I am developing a website were you can make and sell your own book. The Product layout needs some specific features that force me to use Product Variations and using the standard Attributes: so far, ...
0
votes
1answer
21 views

Check for meta data before it is published

I am using a church theme and custom post with its own set of meta data. What i want to do isif a sermon post is published, WP will check whether someone included a video URL. If they do, check the ...
1
vote
2answers
41 views

Can't display errors in attachment_fields_to_save

I am writing a plugin for adding a custom field to the image attachment dialogue box, the plugin works for storing valid input data. I have a problem for showing the error message "This is not a valid ...
0
votes
0answers
18 views

Group posts by month by custom metabox?

is there a way to do this ? August 2009 11 Title of the post of the 11th day of August 15 Title of other post of the 15th day of August 20 Title of another post of the 20th day of August July 2009 4 ...
-1
votes
1answer
122 views

How to show all posts of specific custom post type with their custom fields values?

I am trying to get the list of all posts with post_type "staff" along with custom fields assigned to this post_type. Custom fields were create with help of ACF. I've tried both: $query = new ...
0
votes
1answer
33 views

Query Multiple meta

Hi i've looked through the forum but can't seem to find the right solution to what i'm looking what we have is a property website and have various pages setup to show specific types of properties ...
0
votes
0answers
19 views

Custom Fields with pre-filled content

as this is my first post here I first of all like to say "Thanks" because I found a lot of hints here for my problems in the past. Now I have to ask for the first time: We are offering news under ...
0
votes
1answer
31 views

Display post from a date range from custom field

I currently have a custom post type that has two major custom fields that are need for the query. The 'score_time' field stores time of a score. Example: 12:20 The 'score_date' stores the date the ...
0
votes
1answer
101 views

If Custom Field is empty don't display div

I'm looking for a better way to hide a div when a custom field is empty. I've figured out how to hide the div but I have quite a few custom fields and I'd rather not write the code for each one. ...
0
votes
1answer
37 views

Advanced Custom Fields: Sorting custom columns with custom fields sorts only by date

I have a custom post type – “members”. With help of Advanced Custom Fields(AFC) I’ve created a Field Group with 5 fields and assigned that group to my “members” post type. I followed this article to ...
0
votes
0answers
22 views

Can't pick up a field created with Advanced Custom Fields

I have a situation where: I need to create a custom link per image on an image gallery. I did that via ACF. I have created a text field with HTML outputing so that hyperlinks get converted ...
0
votes
2answers
106 views

How to hide a div based on contents of custom field

I've found several other threads asking this same question, but for some reason I can't seem to make a solution work for me. For clarification, I want to have a custom field that is applied to a post ...
0
votes
1answer
24 views

Need some suggestion/help with custom post types project

i am working on some project where i have custom post types for management courses. I have create new roles (for users) : teacher and student. Now the quasions is what is the right way to assign one ...
0
votes
0answers
17 views

Wordpress Costums Field Comment Box on Admin Page (Post Editing)

can help me about wordpress comment field on post editing in admin page? i want to change the default form like picture above : to like this...
1
vote
2answers
140 views

Custom Field returning Numerical Value for Image rather than URL

I have been trying a way round my latest WordPress problem all morning and I feel now is the right time to shout and ask for help. I have been trying to create a people directory, I'm there except ...
21
votes
6answers
24k 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 ...
0
votes
1answer
69 views

Change post template the proper way

I'm trying to create an option on edit posts screen (backend) to select different post template based the selection and I need your opinions guys if that is the proper way. Here is what I've tried so ...
0
votes
1answer
361 views

echo value from 'select' field type into page template using cmb2?

I'm using CMB2 plugin to add metaboxes into a custom post type. I'm adding the additional metaboxes via functions.php onto child theme. It may worth to mention that parent theme/custom post already ...
0
votes
1answer
45 views

Group by custom field value (start and end times)

I have the following loop that is outputting a schedule for a conference. At the moment it's looping through a custom post type, grabbing the info, then outputting it in a block. So essentially each ...
0
votes
1answer
50 views

How add body_class from wp_termmeta

I need to assign a class to the body for woocommerce categories. What I've done: // add the fields when the term is created add_action( 'product_cat_add_form_fields', 'add_product_cat_class_field', ...
0
votes
0answers
297 views

Generate auto seqential ID number when a new user is registered

First off I found this solution to what I would like to do: generate an auto incremented id number when a new user is registered It is almost there but I would like to extend the functionality a ...
1
vote
1answer
24 views

get_posts that match a user-specified value on a page

On each page, I want the admin to choose which case history post summaries will be displayed depending on the post category. My code below works but it is very clunky if you have lots of categories. ...