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

learn more… | top users | synonyms (2)

1
vote
1answer
38 views

delete custom post based on custom field date

RESOLVED ## updated code below. I had created custom post type called 'esitykset' and I wanted to delete them if they are older that the date in 'show_date' custom field of the post. So I tried the ...
3
votes
4answers
988 views

How I check if the same post slug has not been used before publishing?

For an indie rock agenda I created event posts. With the help of javascript, the custom fields values (bands, places and date info picked in select boxes) are copied as the post title when publishing ...
4
votes
2answers
784 views

How can I display all values of a custom field from posts with a certain value of another custom field or from certain post types?

I know the question is quite ambiguous. Let me explain: I have a page that lists all posts with a certain value of a custom field. (Eg.: The page Rentals lists all posts with the value rental of ...
-1
votes
1answer
21 views

Filter Query Post by Custom Fields(by date)

I want to filter query_post using the 2 meta keys start_date and end_date, i want to get my posts to divide it by upcoming events and past events. start_date and end_date is stored in the timestamp ...
2
votes
0answers
49 views

Download external images with function

Actually, i display images on my site from other sites. Url is on a custom field name "couv" I'd like to download theses pictures on my site and create a new custom field with the new value "couv2" I ...
1
vote
2answers
73 views

Get Meta from Custom Field of Image URL

I have a custom field that is an Image and the return value of the field is Image URL. I have custom page templates where I render these image fields. Is there a way to get the meta info for the ...
0
votes
1answer
25 views

Saved Post Meta Array Returns as String

I am saving an array in post meta using update_post_meta. $arr = array('this', 'or that'); update_post_meta($post_id, 'field', $arr); $ret_arr = get_post_meta($post_id, 'field', true); var_dump($...
2
votes
0answers
31 views

SQL Query to copy value of a meta_key into another meta_key

I am trying to figure out how to replace the value of one advanced custom field with the value from a different custom field. Would anyone be able to help me structure a SQL query that will do this ...
1
vote
1answer
27 views

How can I show custom fields in the loop only to specific user roles?

I've inserted this code in the loop (in single.php): <span style="font-size:16px"> <strong>Currently reading:</strong> <?php the_field('book_name'); ?> (<?php the_field('...
2
votes
0answers
38 views

Using a custom field value to redirect away from a 404 page

I’m moving from an old CMS to WordPress. The old articles are saved as posts and the new WordPress permalink is %post-id%. The old URL slug is unique and saved as a custom field for each post; the ...
0
votes
1answer
150 views

WP REST API - get custom taxonomies based on terms & filter

I need to get the list of data's with taxonomy term property_category,based on this property_category having data's like apartment,house,office etc.For example localhost url given http://192.168.0....
0
votes
1answer
15 views

remove initial wysiwyg editor from cms page edit

So I have successfully installed and implemented the Advanced Custom Fields plugin from: https://www.advancedcustomfields.com/ I have applied a set of custom fields to a custom page template, ...
0
votes
1answer
58 views

Sorting custom post type columns with external data and without meta values

I created a custom post type 'Book', for which data is stored in an external database (like ISBN, author etc). The WordPress database contains the ISBN per custom post, which connects the correct data ...
0
votes
1answer
21 views

How to add content with a filter when there's no content in the editor

I'm building a plugin to create page sections (with ACF and repeater field) and I want to add the sections at the end of the content. The sections are added to the content, but only when there's ...
0
votes
1answer
28 views

Displaying multiple URLs as custom field values

I have been trying to figure out to display multiple custom fields with the same value and do not display them if there is no value entered. This is the piece of code I'm currently using and it ...
0
votes
1answer
30 views

Show first posts with custom field not empty and order all by title

I have a custom post type called "products". My goal is to make my custom query that I have on homepage and also the search query show first the posts that have a custom field called "id_number" not ...
0
votes
0answers
34 views

how to filter the data's comparison operators (>= & <=) & range between values using the WP REST API

I'm quit new for wordpress development. Working with property management website with mobile API Development. Here need to filter the data's for based on conditions like greater than and less than &...
0
votes
1answer
99 views

How to filter or search the posts using postmeta tables custom meta fields with wordpress REST API

I'm new to wordpress and also working with WP REST API for mobile application development for the wordpress website. Here I want get data's filter & search based post meta custom fields. I've ...
0
votes
1answer
29 views

Display list of terms having the same custom field value

I have a custom field for my taxonomy called 'food_type'. How can I display a list of my terms where this custom field's value is set to "Cat food"?
6
votes
3answers
4k views

Can wp_query return posts meta in a single request?

I would like to create a wp_query that would return posts meta inside the posts array. $args = array ( 'post_type' => 'page', 'meta_key' => 'someMetaKeyName', ); // The Query $query = ...
0
votes
0answers
18 views

WordPress loop by three meta values with random order

We have three custom fields with names plan_name1,plan_name2 and plan_name3. Need to check if these meta keys has values (1,2,3) OR (2,3,1) OR (1,3,2) OR (2,1,3) OR (3,2,1) OR (3,1,2) We mean ...
0
votes
1answer
39 views

How to Duplicate (multiple meta box)?

I've made a meta box field which works nice, but now i need to add one more. For the past few hours I've tried to mix every piece of it, to duplicate it, take some parts, google, search, and no luck. ...
1
vote
1answer
49 views

How to display submenus on page based on referring top-level parent?

I am trying to display a secondary menu on pages that displays all the coordinating sub-pages of the top-level menu item they navigated there from, but my issue is that some pages appear under ...
-2
votes
2answers
91 views

Assign class to Drop Down Selections in WooCommerce Products Custom Fields

I have added a drop down to the WooCommerce Inventory Tab where the user can choose message to show in front end. In functions.php: // Display Fields in Back End add_action( '...
0
votes
1answer
36 views

Update field name without losing the value

So I have this photography website using ACF with flexible content. It has approximately 300 posts. Due to requirements, I need to update the name of some fields. I've tried the following query: ...
0
votes
1answer
28 views

Login_form add to top of form rather then bottom

I have added a 3rd field on the login page, but it shows at the bottom(underneath password) while I would like it to show above Username. How can I manipulate the order of fields? This is the code I ...
0
votes
1answer
19 views

Auto populate custom fields by post date

I have an old blog with lots of posts, I created 2 new custom fields "Year" and "Month" using ACF. I would like to auto populate them from the post date after post save/update, is this possible ? ...
0
votes
1answer
45 views

Problem with saving large amount of data in postmeta/usermeta

I am facing issues saving large amount of data in post meta field e.g. I have created a field Bio/description and put a huge amount of text in it. Now when I save it, it saves some of the text and ...
0
votes
1answer
35 views

meta_query 'compare' => '!=' not working

I am using a custom post-type, in post there are a checkbox meta field for featured post. So there are two scenarios. First with featured posts Second with non featured When I called featured ...
0
votes
0answers
24 views

Update custom fields after updating related custom field

I have a custom post type that I'm filtering by a custom field, I then select one of these posts & update it in the front end. But when this is updated, I need to also update the other filtered ...
1
vote
0answers
39 views

Add additional 'description' field for defined roles / role metadata?

Is it possible to add an additional field for "description" to each defined role? (Administrator, Editor etc, plus custom roles). I'm using Justin Tadlock's Members Plugin and have created some ...
0
votes
1answer
70 views

How to display custom field in woocommerce email orders? [closed]

Am having trouble showing custom field data from a select drop down in the order email form in Woocommerce. The data is showing in the admin page order just not email? add_action( '...
0
votes
3answers
2k views

unlink() doesn't delete the uploaded file

I'm using this code in my plugin to add an extra field to the user profiles so that the user can upload an image. It uploads the file perfectly but the only problem is the part that has to delete the ...
4
votes
1answer
60 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
0answers
31 views

Extend Metabox.io map field to sepearate lat long values

I am trying to separate the latitude and longitude values returned by the map field from the metabox.io plugin and save them as separate values. I have found a comment from the author (shown below)...
1
vote
1answer
130 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
2answers
51 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 ...
4
votes
1answer
116 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
0answers
20 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
24 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 $...
7
votes
5answers
10k views

Prevent post from being published if custom fields not filled

I have a custom post type Event that contains a starting and ending date/times custom fields (as metaboxes in the post edit screen). I would like to make sure that an Event cannot get published (or ...
0
votes
0answers
20 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 $...
1
vote
1answer
98 views

Adding auto-complete to custom gravity field not working

I am trying to add auto-complete to my custom fields on gravity forms.But its not working.Data returns but not showing on field.I am doing like this: (function( jQuery ) { jQuery(function() { ...
0
votes
2answers
205 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
56 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
22 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
34 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, YEAR_OF_ADMISSION,...
0
votes
1answer
35 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 ...