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

learn more… | top users | synonyms (2)

4
votes
1answer
56 views

How to use custom fields in post title?

Certain posts of mine will have the custom field release_author in them - others don't. If that field exists, I want to display that in the header.php's title (not in the h1 of the post itself. ...
0
votes
2answers
32 views

Get custom term meta problem on single post type

I'm trying to display a custom field value added to custom taxonomy on single custom post type. I have articles post type with custom taxonomy called issue. I used the code from Tax-Meta-Class to add ...
0
votes
0answers
15 views

List posts that are geotagged within a certain area

I'd like to geotag some post on WP with latitude and longitude in a custom field. It's very easy to show a map with this data but what if I want to show all the posts that are geotagged, let say, in a ...
0
votes
1answer
23 views

Is it possible to retrieve all posts with a certain value for metadata?

Under 4.5, I have posts with meta_key as series and meta_value as 19, 20, etc I am trying to loop through them in a template, and I guess I'm a special kind of dense. Most recently I have tried ...
0
votes
0answers
13 views

Does get_post_meta result in a database query each time?

I want to add some new functionality to a post type. It is going to result in a dynamic number of meta fields. I want to know if i could consolidate the content into a single field (messy) or to ...
0
votes
1answer
28 views

Custom meta is not being saved

I have created the following class in order to add a custom metabox for my posts, but the data is not being saved. Anybody can say what's wrong with my code? class Anotai_Meta_Box { public ...
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
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 ...
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
0answers
22 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
114 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 %) ...
1
vote
1answer
66 views

Update custom field values on edit address page woocommerce

I have two custom fields included in the checkout page and also in the edit address page in myaccounts of woocommerce. The problem is the two custom fields 'billing_door' and 'billing_flatname' are ...
0
votes
1answer
49 views

How to Save settings of custom tab product page in admin side in a database?

I have following code : <tr> <th><?php _e('Custom Stock Message'); ...
1
vote
1answer
126 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
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
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
171 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
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
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
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 ...
4
votes
1answer
110 views

Wordpress 4.4+ : How to revision CPT + metadata

In WordPress 4.4+, how do you enable revisions for Custom Post Types along with their metadata? How can you get this information to appear in the diff view? I've attempted to implement what was ...
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
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
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 ...
1
vote
1answer
108 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
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 ...
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
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
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, ...
-1
votes
1answer
124 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
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
33 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
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
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
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
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...
0
votes
2answers
107 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
103 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
46 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', ...
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. ...
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
0answers
35 views

Create product configurator

I am building a product configurator tool where users can select mutually exclusive/inclusive options and I want to store their configuration at the end for retrieval later. As the user selects option ...
0
votes
0answers
20 views

WP_QUERY with alternating post types and pagination [duplicate]

I want to show both regular posts and a custom post type (event) on the homepage in a single loop. The event post type needs to be ordered by a custom field for the event date and show future events. ...
0
votes
0answers
14 views

why is the value of one field different from another if they are filled with the same variable?

A form is submitted containing a users email address. When the form is submitted, the page that processes the form creates a new post, and it sets the value of the custom meta field called 'entryCode' ...