Questions tagged [custom-field]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
42 views

Render CMB2 select option to post page [closed]

I'm using CMB2 plugin to add select metaboxes into a post. The metabox work fine on the post editor. But failed to render and displaying on post page. The code for post editor add_action( '...
1 vote
0 answers
58 views

Create Unique and Customized User ID for Website Members in WordPress

I want a Feature which can allow Custom User ID creation at Registration on WordPress. This will be different from the User ID that WordPress creates at Registration. This one is something that is ...
0 votes
1 answer
48 views

Custom Fields after update to WordPress 6

I had a site where posts had custom fields and upgraded to WordPress 6 recently. However, now I cannot find the custom fields in the back-end. They still display correctly in the front-end, so the ...
0 votes
0 answers
24 views

Custom fields: Split data from single custom field's sub-array to separate custom fields when saving post

TLDR; I’m using a plugin that stores its custom field data in a sub-array, and I would like to save parts of the data from the sub-array to separate custom fields when a post gets saved. In my case, ...
  • 310
0 votes
0 answers
72 views

Send email on creation of custom post type and use get_post_meta()

I've setup a custom post type and I want to send an email when I publish a post but I want to use some data from the custom fields I've added to that custom post type, including obtaining an email ...
  • 1
0 votes
0 answers
13 views

Grabbing value of input field inside of array

I recently made customized input fields. I was able to grab the values normally with woocommerce_form_field, specifically with the get_value attribute. I want to grab the value of each inputted field ...
0 votes
0 answers
21 views

How can I copy value from dropdown once I select it to text area as text?

How do I copy the value of the department from the dropdown to the text area once I select it? For example if I select IT department I want it to appear in comment text area like "IT Department:&...
0 votes
0 answers
10 views

Dynamically update Custom Fields to display new dates

we are creating a registration page for Zoom meetings, where I just send the details filled in the form to Zoom using a webhook. We want to give the registrants 3 different dates (always on Saturdays ...
0 votes
0 answers
24 views

How do I create a term for every value of a post meta?

I have some information stored in post meta that I'd like to convert to terms. I'd like to create a term in a custom taxonomy for every meta value with a particular key. I need to loop through ALL ...
0 votes
0 answers
13 views

Site uses wpdb to fetch meta_keys but just displays first meta_key from a page (the post uses the same meta_key "filmmaker" more than once)

My page should display all filmmakers, that have been tagged as "filmmaker" in my posts. I do have posts that feature more than one filmmaker (meta_key = filmmaker) in custom fields, but ...
0 votes
1 answer
84 views

How to get all specific fields from one ACF Group?

I have created few question/ answers using ACF. Field names are question_1, question_2 and so on. My codes are: <?php if (get_field('question_1') == 'yes') && (get_field('question_2') == '...
  • 51
1 vote
1 answer
59 views

How to detect if an ACF custom-field is really in use?

I want to find out if a custom-field is in use for a post or term. That means the custom-field has a content and is not empty. I guess that's more difficult for selects, radio or checkbox-inputs. So ...
1 vote
0 answers
17 views

WP query with variables gives no result for specific user

I'm trying to fetch one custom post with two values: the logged in user ID and a known string, both as variables. The query works out fine when testing on an admin account where the user ID is 1 and ...
0 votes
0 answers
23 views

Function to Compare CPT Post Custom Value with Default Posts CF Value

I want to create function for compare custom field values of CPT Posts with default posts CF Value. As of now I implemented below code in template file which is working fine, but I want to create ...
  • 37
0 votes
0 answers
17 views

Save And Display Mp3 Audio files on WooCommerce product page with Dokan

so basically I use dokan as my multivendor shop and I want to give sellers the option to add an MP3 Demo of their product that will display on product page. https://wedevs.com/blog/409723/how-to-add-...
  • 1
0 votes
0 answers
33 views

Advice how to connect custom database with Wordpress, change data in Wordpress and finaly use this data

Is it possible to create a page in WordPress that will allow logged-in users to create new or change existing content from the custom database? So I think this task could be divided into three parts: ...
0 votes
1 answer
110 views

Display ACF object field data using Elementor Custom Query

Hello i'm working on a website using elementor pro + ACF. I have create a custom post type (CPT1) with ACF object field that take another CPT2 as values. I would like to display on my CPT1 page all ...
0 votes
0 answers
7 views

How to apply Local Business Google Schema dynamically on a Custom Post single template?

I have a Custom Post Type called "Locations". This post type contains ACF fields including the address. I've been tasked with adding Local Business Structured Data (https://developers.google....
0 votes
0 answers
24 views

Create taxonomy terms from custom field values

I have a CPT 'Candidates', where its custom fields are being fetch from an API. I am planning to convert/associate the values of these custom fields as taxonomy terms. Because I need to filter the '...
0 votes
0 answers
23 views

Mandatory field in Custom post

I am learning WordPress Plugin Development. How can I make Mandatory Fields in Custom Post ?
  • 407
0 votes
0 answers
27 views

How do I ensure that post_type and Taxonomy use the same slug?

I had to create a Custom Post Type and taxonomy to add a question and answer section to my site. But I want both of them to use the same persistent link. The codes are like this, so one of the two ...
1 vote
2 answers
63 views

How Do I Add HTML Support to the Additional Category Description Field?

I created an additional description field for categories, but what I write in html is saved in MSQL without html, how can I add HTML support to this field? For example, I write a statement like this: &...
0 votes
0 answers
635 views

How to create repeater field manually, without plugin (ACF Pro)?

Looking for a way to register a custom field to appear on specific pages or post types, that would behave as a repeater, whose content I could then get on the front. Paying for ACF Pro for one small ...
0 votes
0 answers
32 views

How to make an API call to a custom post type but filtering by meta value?

Apologies, if I don't explain this in the best way as I'm not experienced with APIs and such (mostly only use no code tools). I have a custom post type called "Advertisers". I want to search ...
0 votes
0 answers
13 views

add_filter get array data before display in custom post_type

I have custom "register_post_type" before display data I want to process some data. I cannot found out how to get to data like add_action('the_post', 'my_function') Problem that I have is ...
0 votes
1 answer
12 views

Display Additional Info

Hello guys, i have this problem. I added this additional field but i can't get the value for that specific field I'm using this code but shows nothing: ($field['type'] === 'cedula' && !empty($...
0 votes
0 answers
30 views

how to create meta key name in wp_usermeta table in database

i want to add a field in wordpress registration form. for example a field for getting phone number. but i want that field create a meta key name in wp_usermeta table (in the database). how should we ...
0 votes
0 answers
28 views

Redirect DRAFT Posts to a Custom URL (Custom Field) : Currently 404 Page

I am trying to create a function that REDIRECTs Draft and Trashed Posts to a custom field I have in all of my posts. I am calling this function at the start of header.php, however the webpage just ...
0 votes
0 answers
22 views

Display the output from Custom User Fields from a Wordpress user profile on a Wordpress Custom Page

I created Custom User Fields on a User Profile Using this tutorial. How do I add a field on the Users profile? For example, country, age etc. I created three custom fields with the names: "ID&...
0 votes
0 answers
110 views

Creating New Dynamic Fields for a Certificate (Number Generation, Code Referencing, and more)

I'm making a certificate that's supposed to autogenerate and involves the need for multiple dynamic fields. I have everything else finished but I have difficulty trying to create 3 dynamic fields. ...
0 votes
1 answer
134 views

Display posts with specific value first in query

I would like to display posts that have a certain value in a meta field first. I would like to display posts that have a certain value in a meta field first. I have tried it with meta_query and ...
  • 159
0 votes
1 answer
16 views

if custom field doesn't exist, use post thumbnail instead, as image background

I am trying to modify a code in my theme, but I only partially succeed. I need a working condition, if a custom field is not present, to use the post thumbnail instead, as the background image. if the ...
  • 167
0 votes
0 answers
25 views

Is it possible to add custom badges to product attributes conditionally, based on custom field?

Client wants to add "Popular" badge to product based conditionally based on a custom field. Is it possible to implement something like that and if it is how would you go about this. Thank ...
2 votes
1 answer
486 views

Update post meta custom field using block editor

I have a custom mapping plugin that (among other things) saves/updates coordinates to a custom field when the user drags a map marker within a custom block. Everything works as expected except for the ...
  • 53
0 votes
1 answer
18 views

Intiger meta value with '>=' returns posts with lower value

My post has a custom post meta named duration. which has the video duration in seconds. Like, Post 1's duration: 1 Post 2's duration: 56 Post 3's duration: 155 Post 4's duration: 7 Post 5's duration: ...
0 votes
0 answers
22 views

meta_query weird behaviour, static int will work, but not user data

I am currently trying to build a Ajax filter for a CPT, all the products have a min and max value of a specific range in which the products works best. Therefore i created ACF groups with a min and ...
0 votes
1 answer
45 views

How to use custom fields like Title to show value in content?

I need some automation in my Wordpress Blog. As we type Title and it appears in post. How can we add fields like Title? Then how I can show the value of those fields in my single-post. I want to use ...
0 votes
0 answers
52 views

Migrate Custom Post Type with Custom Fields data and parent child order

Hello WordPress community, I'm trying to migrate my one WordPress custom post type data to another WordPress site and I tried to migrate with SQL and WordPress's default export/import function but not ...
  • 37
0 votes
0 answers
37 views

Populate custom checkout fields with data from previous orders

I have created a few custom checkout fields using the WooCommerce documentation available here: https://woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/ My ...
0 votes
1 answer
34 views

Update value inside array update_post_meta

I am trying to change default values inside array in custom field. But I am getting error "PHP Fatal error: Uncaught Error: Cannot use string offset as an array" when I try to change the ...
0 votes
0 answers
21 views

WP query_posts group by meta field related

Hello Guys i am trying to customize a wordpress theme and am getting this is How it queries All Posts with episodes post_type. My Question Is. this Post type is related to another post_type which is ...
0 votes
1 answer
30 views

Get previous and next custom post by custom field

I try to get previous and next post so I do this : $args = array( 'post_type' => 'event', 'post_status' => 'publish', //'posts_per_page' => 1, '...
  • 1
0 votes
0 answers
20 views

Woocommerce Custom Meta Boxes- How to only display if they actually have content

I've managed to add two custom meta fields to the backend of woocommerce, shipping and size guides, using the add_meta_boxes function, as I don't want to use the woocommerce custom fields section as ...
0 votes
2 answers
31 views

Need to search a custom field (ingredients, one long string per post), but want it to allow phrases/non-exact matches

So I have a complex list of ACF repeaters for ingredients, but have a save hook to store them all as one comma delimited text string in a custom field to help. My current "advanced" search ...
  • 101
0 votes
0 answers
22 views

Custom fields for post or terms which don't update on post update

I need to have custom fields for each post and terms. But how can I create these fields which don't update when post or terms is updated in backend. For example: Lets suppose we have a custom field ...
0 votes
0 answers
33 views

Display custom post front end filter by ACF equals current user

Let me try to be as clear as possible : I would like to display my custom post on Front-end. I made a Back-office for a mobile app, but I'd like to create an access from front-end to display some ...
0 votes
1 answer
86 views

Meta field bulk editing no longer working in WP 6.0 [closed]

Until recently, I was using the following PHP and jQuery code for adding bulk editing support for a meta field (price) in a custom post type (Book): PHP: function show_bulk_edit_book_metabox( $...
  • 1,696
0 votes
1 answer
21 views

Hide custom column in admin template screen (Elementor) [closed]

My plugin adds a custom column to admin posts and pages screens but it's also adding it to the Templates (Elementor) screen. I know users can hide this themselves, but I'd rather do it in my plugin. ...
0 votes
1 answer
61 views

Conditionally run function based on custom meta value?

I’m looking for a way to conditionally display an image within certain Woocommerce hooks that I choose based on whether a value is true within a custom meta field for the products on my site. For ...
0 votes
1 answer
556 views

How do I upload file through custom field, save it to database and get it

I have made a custom field without any plugin. When I choose file I want to upload that file and get its url on my page. Basically, I want to upload video and show it on frontend. This is my code ...

1
2
3 4 5
74