Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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
2k views

Create Meta boxes dynamically

I followed and created a meta box using all code from this question here: Create more Meta Boxes as needed Basically only two fields are created when you click on Add track button: Song title field ...
0 votes
0 answers
8 views

I am trying to add form using ACF plugin and acf_form() function, but my user fields dont show up properly

I am new at wordpress, so i am very sorry if this is a stupid question, but anyway... I am trying to create form on frontend to add my custom post types with custom fields which i created using ACF ...
1 vote
1 answer
293 views

Set a maxlength for the title input in a custom post type

I'm creating a new custom post type. But I need to limit the max length for the title. This is how I'm creating the field in my code: array( 'key' => 'title', 'label' => 'Title', '...
0 votes
1 answer
1k views

Woocommerce products search with custom fields

i have a woocommerce e-shop website. My search is searching only in product title, short description and SKU fields. I want to search also in some custom fields (like "_barcode" and "...
1 vote
1 answer
2k views

Search custom post type posts only by meta fields?

is it possibile to search custom post type product by _sku or other custom meta field with input text field? I don't want to use plugin, just need custom WP function. I have found this solution for ...
0 votes
1 answer
695 views

update meta field value after

I am trying to update meta field value. Everything ok, problem is that field value does not showing in field after refreshing the page. For example, when I update name value then its does not show ...
0 votes
2 answers
2k views

Insert wp gallery shortcode into custom textarea

Is there a way to insert wp gallery shortcode into custom metabox textarea ? I would like to have something like this: New metabox in post/page with textarea and below textarea there are a button to ...
0 votes
1 answer
2k views

Allow HTML in Custom Metabox area

I know there are many questions related to my question, but sincerely i was unable to get solution. My question is simple, how can i allow html in textarea in custom metabox on post. So far i have ...
1 vote
1 answer
2k views

Filter custom post types by a field value

I have custom post type of an animal type. (I.E I created an animals collection). I want to give the user a drop down to select the gender and filter the displayed custom post types entries ...
0 votes
1 answer
723 views

Custom field in external Javascript

How do I use a custom filed value in an external javascript? I'd like to use a custom field already stored for a post that is an url in an external javascript <script type='text/javascript' src='...
0 votes
0 answers
9 views

How to hide a field on the frontend of a Buddypress page by field ID according to user roles and login status?

Not sure if this is the right place to post this or if I should use stack overflow. I can post it elsewhere if needed. I am not a developer. I have very basic understanding of CSS classes (which is ...
0 votes
1 answer
3k views

Adding more fields to the registration form

Am using Jupiter theme. https://demos.artbees.net/jupiter/labrandeus/ The registration has by default username and password fields. The view for it is defined as below: <?php if (get_option('...
1 vote
1 answer
26 views

Many CPT is conflicting of the custom date

How can I fix the date with multiple Wordpress CPT date? An example, the custom post "John The Man" on "Canada" CPT the birthday is "Thursday 05 May 1960". How can I ...
0 votes
1 answer
701 views

How to display custom fields as table in Woocommerce

I imported around 7000 products into a WooCommerce project I'm working on, and each product has specifications, and I would like to display them in a table, like something you would see on Amazon for ...
0 votes
2 answers
2k views

How to get all wp_posts in wordpress fetched from database

I have downloaded a theme and installed it. Here the theme has custom fields for limited numbers. For ex. author_name, comments but, I want all the wp_posts to be displayed. And prior to that, ...
0 votes
1 answer
720 views

Override WordPress core post-template.php block template

I need to modify the default markup generated using the render_block_core_post_template function located inside wp-includes > blocks > post-template.php. I don't see any other way of modifying ...
0 votes
1 answer
19 views

WP_Query not using relation key as expected and not producing any results

I have created a custom post type service-provider with custom taxonomies region and service-category - By itself, this search works as expected BUT I want to also search on an ACF field. I have an ...
0 votes
0 answers
31 views

Custom fields - get_post_meta giving null

I have in the heder.php the following snippet: <?php $schema = get_post_meta(get_the_ID(), 'schema', true); if (!empty($schema)) { echo $schema; } ?> And in some posts I have the custom ...
1 vote
1 answer
1k views

How to VAR_DUMP a $variable during checkout process (Is my product meta callable?)

Sorry guys, had to post this again as site wouldn't let me respond to comments (new account). I have been working on some code to decrease quantity of a variable product based on the numeric values ...
0 votes
2 answers
1k views

Check if value exists before saving

I added an extra registration field: function wooc_extra_register_fields() { ?><p class="form-row form-row-first"> <label for="billing_cpf"><?php _e( 'CPF', 'woocommerce'...
0 votes
1 answer
1k views

How to show ACF fields in Gridbuilder custom block

I'm using GridBuilder WP (great plugin, average support) to show a grid of a custom post type. Ultimately, I need to show an ACF taxonomy field, and their support have recommended using one of their ...
0 votes
1 answer
1k views

Order posts by title and custom field value?

I want to order posts by title, but always show featured posts first. I have the code below to order posts by title. Now I would like to always show posts first that have the metafield '...
0 votes
1 answer
2k views

Filter custom WP_Query by first letter of a custom field - hopefully using Search and Filter Pro?

I have a custom WP_query that very simply filters a custom post type: <?php $query = new WP_Query( array( 'post_type' => 'professionals', 'search_filter_id' => '204' ) ); ?...
0 votes
1 answer
887 views

How to delete WooCommerce Products than have a specific custom field?

I'm using a plugin that adds a wholesale price to WooCommerce products. Now I need to delete all the products that have an empty wholesale price to only keep the products I want to keep on the ...
1 vote
2 answers
1k views

Automatically add custom fields value to wordpress post

i want to auto add custom field value when post publish , my custom fields name is "quality" and the value is "HD" . i've look through this site and apparently codes i found is not working. so far i'...
0 votes
1 answer
819 views

Custom field group on page

I have what I hope is an easy question to answer, even if google has failed to provide me any solution. Our main webmaster has set up custom field groups which we use with our custom post types for ...
0 votes
2 answers
965 views

Automatically convert standard posts with custom fields to custom post types

I am just beginning a page, and for my current purposes it seems that the only extra things I need are a couple of extra fields for posts of a certain category. Because I only need to add a little ...
3 votes
1 answer
915 views

Revolution Slider Orderby Two Custom Fields

I have create Revolution Slider which load the custom post type, Events. There are two custom fields, Event Start Date and Event End Date. I would like to display order by Start and End date. Because ...
0 votes
1 answer
6 views

Custom fields empty after refreshing page

I have added some custom fields to the Gutenberg editor, the purpose is getting these custom fields loaded in the custom-post-type. Thats is all working, I was able to get the custom-fields in the ...
1 vote
0 answers
48 views

How to conditionally change template based on ACF field in WordPress 6.5 with FSE theme?

I'm currently working with WordPress 6.5 and using a Full Site Editor (FSE) theme. I need to dynamically change the template of a page based on the value of an Advanced Custom Fields (ACF) custom ...
0 votes
2 answers
368 views

How to display WordPress Twenty Twenty-Four's built-in custom field in a post (or page)?

WordPress's Twenty Twenty-Four theme makes it possible to add custom fields directly in the editor, but I simply cannot figure out how to display such fields within a post or page (without a plugin). ...
0 votes
1 answer
739 views

Unable to change checkout placeholder text

I am using woocommerce with storefront and on the checkout the placeholder text for address 1 is "street name" and address 2 is "apartment number". In my country it should be the opposite, or all in ...
2 votes
2 answers
806 views

Outputting an array of term meta values in a custom WooCommerce tab?

Forgive me – my Wordpress/PHP skills are hilariously rudimentary, so I may not use the correct terminology. I have added a custom tab to the WooCommerce single product page and need it to display a ...
0 votes
1 answer
804 views

automatically add custom fields to post title

im going to add custom fields to post title , my post title is "Marroon Five" and my custom fields is "release-year" and with value "2017" . so how to make the output : Marroon Five (2017) this is ...
0 votes
1 answer
934 views

Multi Photo Upload with Caption on Front End for Custom Post Type

I have a page template that allows users to create posts (for a custom post type) on the front end and upload (multiple) images. Currently it works fine but I would like to enhance it by adding the ...
1 vote
1 answer
886 views

Order by empty custom field

I order my posts by custom field faq-order. That's work for me: $faqArgs = array( 'post_type' => 'faq', 'meta_key' => 'faq-order', 'order' => 'ASC', 'orderby' => '...
0 votes
2 answers
18 views

how to compare date meta value in jet smart filter Date query?

trying to compare meta value between today and next 7 days, tried this in value field %today%, %str_to_time|+ 1 week% but its not working.
0 votes
0 answers
18 views

Problem with custom user fields default value and retrieval

I created 2 custom fields for users on my site, a Company name and a checkbox for whether a user has download access or not. Here is the snippet for the functionality: add_action( 'edit_user_profile', ...
0 votes
1 answer
3k views

Custom user registration fields in user_register hook

I am trying to send an email to administrator with user_register action hook and wp_mail() function when a new user registers. I created some custom registration fields and I want send them via e-mail,...
0 votes
1 answer
1k views

UPDATE on SELECT results. A SQL query to swap Author with Meta Box value

I inherited a project where, for some reason, the previous developer make a custom post type for authors and a custom select listing all those authors cpt titles in the post edit screen. This led to a ...
0 votes
1 answer
740 views

Adding Custom Metadata to my Archive/Posts page

I am currently working on a news website and using the Wordpress archive feature to display all my posts in a feed (when you click on the post titles you are taken to the source website).I need to add ...
2 votes
1 answer
970 views

handling csv data with a custom post type

I have a custom post type which represents a 'race' and there are meta fields for 'distance' (5km,10Mile) and 'type' (track,road,crosscountry). We get the race results as a csv file which contains the ...
0 votes
1 answer
713 views

Output Custom Field value to shortcode

I am trying to automate a whole bulk of my pages and one of the shortcodes I have created is to output the NextGen Gallery Tags by using the page custom fields that each page has a unique id. This id ...
0 votes
1 answer
1k views

Custom Meta Box (SELECT) Not Saving

I am trying to create a meta box with select options for each page with home-page-template.php assigned to it. I have got that functionality working correctly. I also want it above the editor, below ...
0 votes
1 answer
4k views

How to use ACF with javascript to update custom field values?

I want to track the number of button clicks in my coupon website. The button values are retrieved from custom fields created using the ACF plugin. I have a custom field total_clicks. Every time when ...
1 vote
2 answers
1k views

Assign Taxonomy Based on Custom Field Value

I have a custom post type "vegetables" I have a series of custom fields for each month of the year as check boxes I have a custom taxonomy "Seasons" that I want to assign based on what boxes are ...
1 vote
1 answer
1k views

Include woocommerce custom field value in front-end search result

currently the search result only showing all the woocommerce default product field (product title, category, tag, .etc). I've add a new custom field inside the woocommerce product using this code ...
1 vote
1 answer
731 views

Saving Custom Field Data before Publish

When creating a page or a post WordPress lets the content (title, body, featured image) be saved when using Ctrl + S. The Custom Fields do not save in the same way (in this case I'm using Advanced ...
0 votes
1 answer
979 views

Read more to open external link

I would like to have custom field in post editing area where can be putted the external link. If the link is entered to this field then read more button on homepage would open external link, but if ...
0 votes
1 answer
828 views

adding autosave feature to custom fields

Does anyone know how to add autosave feature for advanced custom fields or add acf to the autosave event. I searched about it but I didn't find any solution. thank you

1
2 3 4 5
75