Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [custom-field]

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

0
votes
0answers
20 views

Job search using custom fields

I am working on a job search page. I have created job category, job location, job description and posted date using Advanced Custom Fields. I want to display the job location and category in a select ...
0
votes
1answer
17 views

SQL query to change the value of a Custom Field

I am looking for a SQL query to change the value of a custom field, but not on all posts. Some posts have in the "post_template" custom field a "temp1" value, and I want to change this value to "...
0
votes
1answer
29 views

Ajax is not working in a loop

I am trying to show data associated with selected categories by using ajax. Its working only for the last term selected, not for all the selected terms. Any help would be highly appreciated. var ...
-1
votes
0answers
14 views

load more button in plugin

I wrote a simple plugin which creates a post type named cryptoevent and also creates a metabox that have some custom fields, I display this post type and fields with WP_Query, now I want to display ...
1
vote
1answer
19 views

Meta Query Filtering not working on Custom Meta Box using Radio Buttons

I have a custom post type called "bids". I'm trying to get the loop to filter posts according to a meta_query. The query should allow for only posts that have the radio button with the value "open" ...
0
votes
0answers
13 views

Hiding Dropdown Fields

I'd like to hide a field based on the selection of separate field. Basically, I'd like to only display the "State" dropdown if United States is selected from the "Country" dropdown. I have downloaded ...
-1
votes
0answers
9 views

Custom Field are disapear [closed]

On many of my website Custom fields are disapear from post, page, portfolio. I don't use ACF. How i can fix it ? Cheers J.
0
votes
0answers
23 views

How can I stop an custom field value from appearing in a dropdown list

I have a dropdown field that displays custom values that I can add from the admin portal. I would like to exclude an option called 'Meal' so it does not show in the dropdown field on the frontend The ...
0
votes
1answer
24 views

Use custom field value as href

I created a custom field and would like to use its value as the href on a tag that would go on my footer. The custom field is on the Settings > General area of the dashboard and I used ...
0
votes
0answers
19 views

Show Post columns to specific users on condition

I have a CPT called Topics. And admin or editor can only make topics and It can be assigned to authors. I have a meta box where there will be a list of authors and Admin/Editor can choose whom to ...
2
votes
1answer
20 views

Group posts by custom field

I am trying to display a list of all child pages using wp_query and so far I have created a function that retrieves all the child pages for the current page, however I need to sort these pages into 2 ...
0
votes
1answer
22 views

Displaying Custom Fields from Custom Post Types

I've been looking everywhere and still don't understand how to display the information from some of the Custom Post Types on my site (took over the site for a new client). The previous developer had ...
0
votes
0answers
26 views

Add metabox to document tab in gutenberg

How can I add custom metabox in document tab in gutenberg? There is documentation about adding plugin sidebar here, but I'm looking for adding custom metabox in existing document tab.
0
votes
0answers
8 views

Override billing fields with custom values defined in woocommerce_checkout_fields filter

I am trying to override the billing form values in WooCommerce with the following code in my child-themes functions.php: add_filter( 'woocommerce_checkout_fields' , 'checkout_field_defaults' ); ...
0
votes
1answer
30 views

I want to display the content of a text field only if it has been entered

I need a little help with my very first plugin. It's not that big a plugin and consists of a small settings page with 3 text fields that display on the woocommerce checkout page with some css. I'm ...
1
vote
1answer
12 views

How to create shortcode to display custom field value on a custom post type

in my ad site I was trying to create shortcode of some custom fields I created on a custom post type. I'll explain In the single post, there are the custom fields and are shown in a standard way in ...
0
votes
2answers
22 views

ACF not showing

I have a (weird) issue - can't get the ACF field to work on my page. I have a simple text_field and it shows on the Homepage page section: ACF settings: Homepage settings (when I refresh the panel ...
0
votes
1answer
22 views

Is there a way to determine which user changed a custom field (and when)?

A custom field on posts in my Wordpress installation stores an image URL. I need to know when this custom field was updated, and by which user, for a particular post. I know this data is not stored ...
0
votes
0answers
27 views

how to execute custom field for structured data?

newbie here, Through research, I came up with the article focusing the use of the custom field to implement json+ld schema markup for a WordPress page/ post. The code is $schemamarkup = ...
1
vote
1answer
26 views

wp_query to find posts by year and month

I need to create sorting by year and month of custom post type in taxonomy archive page. Like this: Here is shown year, if post exists in that year. And Highlighted month if post exists in that ...
0
votes
1answer
40 views

Woocommerce - display custom billing field in user edit page (user-edit.php)

I created several custom billing fields, correctly populated when the user checkouts. I could show them ( view/edit them ) in every section of woocommerce, but definitely i cannot show them in the ...
0
votes
0answers
30 views

get custom post meta inside custom taxonomy

Hello I create a taxonomy for one of my custom type and add meta field on the backend , I would like to display it in the front end , my code is currently: Could you help me ? /* Add Image Upload to ...
1
vote
1answer
14 views

How do I update a field of a meta box?

While parsing data from a CVS file into a custom post type, i would like to parse data into the fields of a meta box, that I created. The meta box fields are normally updated like this: function ...
0
votes
0answers
46 views

use custom field value as featured image

I know this has been investigated before but no one has given a solution. Besides, I have not enough Stack-reputation to add comments, so I have to ask a new question. I want to use a post's custom-...
0
votes
0answers
32 views

Metabox/Custom fields are not saving input data

I think I was doing everything right but my data doesn't save. What is wrong with this code? add_action( 'add_meta_boxes', 'niloyrudra_add_meta_boxes' ); add_action( 'save_post' 'save', 10, 2 ); ...
1
vote
1answer
13 views

adding extra wordpress user info from registration form

I am trying to add some extra user profile information from a wordpress registration form. But only the standard wordpress user info is being added. Can this work just using wp_insert_user or do I ...
0
votes
0answers
9 views

add_meta_box does not display meta box in Admin

I have two wordpress sites: 1) running on localhost server (PHP7.3) 2) hosted on Bluehost.com (PHP7.2) The metabox gets added on my local website, but the same piece of code does not work on ...
0
votes
0answers
29 views

How To Manipulate Custom Field Data Before It's Published?

I have a custom field called "rehub_offer_product_url" for posts. Suppose I want to add another text "welcome" after the value of this custom field and then publish the post. Example - Suppose, I go ...
0
votes
0answers
26 views

WP post meta - for loop inside for loop

I wanna make a portfolio on-click opening images gallery using meta fields. So firstly I make array of portfolio images and loop them. Then I loop gallery images of every portfolio item, but it loops ...
1
vote
1answer
28 views

Including metaboxes from custom post types in global search — continued

I've seen several questions about including the content of meta-fields in a wordpress search. My question is not a duplicate of these. Background The issue I'm having stems from how meta queries ...
1
vote
1answer
26 views

two custom fields question

Two questions I need an updated code for this question How can I hide the value if there is no value entered? My value would be a link, and this is my current code <a href="<?php echo ...
0
votes
0answers
12 views

Woocommerce / Wordpress: woocommerce_add_order_item_meta question

I'm adding custom meta to my products in Woocommerce with this function which works fine: function wdm_add_item_meta($item_data, $cart_item) { //here we get the name of the protein source name which ...
0
votes
1answer
17 views

Is there a way to set default custom fields when creating a new post?

When I'm creating a new post, just after clicking "Add New", when the post editor shows, instead of having to use the dropdown and choose a custom field to use, I'd like to have some default custom ...
0
votes
1answer
22 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
0
votes
1answer
15 views

Displaying posts inside table having issues

I am trying to create a comparsion table like the attached image. But it was not working like in the image. for that i have done following code what i am getting is not like the image for example the ...
0
votes
0answers
15 views

Display post number for multiple categories

I would like to display sequential numbers that coordinate to posts in different categories i.e.: Category 1 -> Post 1, Post 2, Post 3; Category 2 -> Post 1, Post 2, Post 3). I have the code from a ...
1
vote
0answers
37 views

extend Meta Box / Document Panel

For a project, I'm trying to figure out the best way to implement a checkbox, related to a post type. What I'm trying to to: On the final website, there should be a dropdown-button, with upcoming ...
0
votes
1answer
36 views

How Can I Concatenate A String With One Of My Custom Field Value Before Saving The Post?

My website is a daily deals and offers site. I promote many online stores with affiliate links. I have created a php script to detect any merchant's link (ex- Amazon) and convert it to my affiliate ...
1
vote
1answer
16 views

Hide custom meta data if empty

I have a custom field created for WooCommerce products. I am using the below code to create // ADD CUSTOM WOO DATA add_action('woocommerce_product_options_general_product_data', '...
1
vote
0answers
11 views

Woocomerce custom billing address fields display in order details [closed]

In woocommerce I register a custom billing field to can track the house number separately function addCheckoutHouseNrField($fields) { $fields['billing_house_nr'] = array( 'label' => __(...
1
vote
2answers
39 views

tracking number field in Woocommerce order [closed]

I am creating a custom field Tracking_ID on Woocommerce, where the admin will enter the tracking ID as value. How can i get the value of the created custom field and display it inside the customer-...
1
vote
0answers
21 views

Understanding the orderby in WP_Query?

For quite a while I have been trying to query posts, with 2 different meta_queries, and order them differently. I followed the WP codex. Recently I have found out that I have been mistaken this ...
0
votes
1answer
11 views

meta_query to check all custom fields

I have to use the meta_query argument so that it checks for a keyword in all available custom field values (in array format) saved for the object. The meta keys are different for every object, ...
0
votes
1answer
20 views

Any way to make custom taxonomy field searchable?

I have added custom taxonomy field on tags, but when I search that field search is not working. Any way to make it searchable in WordPress dashboard?
0
votes
0answers
32 views

Order 2 meta_queries differently in WP_Query?

I have a custom WP_Query with 2 different meta queries. I want to order the results of both queries differently. The first meta_query I want to order by a custom field (high integer - low integer). ...
1
vote
1answer
45 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
0answers
7 views

How to show other options when selecting certain option on custom widget?

Please have a look at an image and you will understand my problem clearly. I have custom widget to display the posts. As you can see image, i have layout of posts listing. Layout One and Layout two. ...
0
votes
0answers
15 views

Hidden input's value is overrided by acf

I am using acf_form() for user login process. I am doing login process using Ajax and everything is done inside wordpress’ ajax callback function. so I inserted a hidden field inside the form by acf/...
0
votes
0answers
8 views

How users can add custom post type to their own bucket?

I would like any users connected have the possibility to add post to their own category. They can choose the name of this category. Default is bucket. Example : There a 3 posts. Each user can add ...
1
vote
1answer
36 views

Global $post not working in OOP function WordPress

I added a custom field with comment form. Below is my code.First function return post id when using var_dump function.But the last function return NULL always. class Post_Rating_Public_Helper { ...