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
0 answers
146 views

How can I add a field for featured image on backend of a custom Taxonomy?

I came accross this problem when trying to create a new wordpress Theme, I want to add a custom term field for featured images on the backend of a custom taxonomy, I have followed this tutorial and ...
0 votes
0 answers
42 views

Best approach to make all tags searchable by the wordpress search function

I have over 2000 tags on one of my sites and I like them to be searchable by the wordpress search function. The problem is if I use a plugin, the time it takes to search them all is enormous. I think ...
  • 299
0 votes
1 answer
49 views

Save all the post tags inside a custom field

I'm having some trouble to add_post_meta using the code below with all the post tags inside a custom field. The code works to echo all the tags, but not for saving them because it only saves the first ...
  • 299
0 votes
0 answers
15 views

WooCommerce Meta

I have 4 fields names date_1, date_2, date_3, date_4 which are not always displayed to the customer on checkout (Plugin: Custom Field Editor). One of these 4 meta-fields exists and the other 3 don't ...
  • 1
0 votes
0 answers
78 views

Woocommerce Shortcode which displays a table with product data

I searched for the internet but didnt find anything which works to my use case. I want to have a shortcode which displays a table of products. In each row I want the product to have the following data:...
  • 101
0 votes
0 answers
45 views

Orderby meta_key/meta_value not displaying anything, am I overlooking anything?

I have an issue with my orderby using get_posts(). I want to order in alphabetical order a list by city name using a custom meta field, but it comes back empty. However when I orderby title, the list ...
0 votes
0 answers
22 views

add_comment_meta not working properly

I have a scenario where I need to retrieve a custom field ('current_module') from a comment author's user profile and add it to a custom field ('author_current_module') associated with any comment ...
0 votes
0 answers
445 views

Query ACF relationship field - Comparator IN - Value array

I have two custom post type with a relationship custom field to linked them. I try to do a query based on this custom field using the comparator IN and some IDs in an array, but so far with no success....
  • 105
0 votes
0 answers
260 views

how to enable custom fields in the Gutenberg post editor

Apparently (from this website); To view your custom fields using native WP functionality, click the settings button (three dots) and then go to options, where you can enable the Custom Fields box. ...
  • 1,666
0 votes
1 answer
31 views

finding and using post type fields in Wordpress

Sorry if this question is repeated, i asked on stackoverflow before but then i found out this place and got a message to wait before posting again, maybe it was just a bug. I am working on a premade ...
1 vote
0 answers
31 views

Can we create a WordPress read-only virtual field derived from three other fields?

Our app has three different dates representing three key dates for a Project (one of our PODS CPTs). One of the common calculations we make is deriving an overall "Status" of the project ...
1 vote
0 answers
126 views

Cannot add custom field to "orderby" parameter in Rest API

My goal is to order a list of stars based on their distance from Earth, so I have created a "distance" field. The “distance” field is a meta field I’ve added. Looking at the WP API endpoints,...
0 votes
1 answer
225 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 ...
  • 125
0 votes
0 answers
90 views

Adding data to User profile

Some plugins for wordpress add fields to the users profile. For example "Company" or "Store" or "Group". How can I add the values to this fields from a custom a frontend ...
  • 1
0 votes
0 answers
90 views

How to sort WP_Query by a custom text field (written as a date dd/mm/yyyy)

I have an ACF text field for a CPT that is holding a date in DD/MM/YYYY format (it's a text field and not a datepicker field as the data was imported from a CSV file). My Wordpress loop then sorts by ...
  • 3
0 votes
1 answer
33 views

update_post_meta

I am trying to update a custom field for a custom post type with this function php add_action('wp_ajax_updatemeta', 'toggle_task_status'); add_action('wp_ajax_nopriv_updatemeta', 'toggle_task_status');...
0 votes
1 answer
52 views

How to store the third party script with HTML code in the wordpress custom input field?

I have created a custom field on my custom post. Below is the code I am using for the custom field. <?php function wpt_add_thirdpartyvideo_metaboxes() { add_meta_box( '...
1 vote
0 answers
196 views

Strange issue saving custom field data for a WooCommerce order

I have an issue with WordPress update_post_meta() function. So I have made a custom input field for WooCommerce orders which hold Tracking number. Most of the time everything is running smooth and I ...
0 votes
2 answers
213 views

List custom queried terms in the edit-tags.php?taxonomy page

This is my first time posting a question here. I have this problem that I feel that I am soooo close to solve, but can't manage to do it. I have a custom taxonomy called "aplication" and ...
  • 11
0 votes
1 answer
571 views

User query - getting values for custom meta keys/fields

I am beginner at customizing wordpress but have some experience in PHP coding. I'm struggling to figure out how to display all existing meta keys (custom fields defined by ACF) for all users that have ...
0 votes
1 answer
486 views

ACF: How to get users with a ACF flexible content subfield with a specific value AND layout?

I am looking for a way to query users based on a user meta entry for an advanced custom field which has a given value and itself is from a given layout type. For example, let's say I have the ...
0 votes
1 answer
31 views

Custom Post Meta from custom metaboxes is randomly being deleted

For a while now I've been applying and updating some custom metaboxes that my company re-uses on different sites. (Not the same metaboxes, but the same methodology.) Essentially it allows for the '...
  • 1,935
0 votes
1 answer
118 views

ACF: How to query for a given value count of an array like field? (e.g.: How many rows has a `flexible_content` field?)

How can I write a WordPress meta query that gives me an array of users/posts that have a given amount of entries in a custom field that stores multiple values? Something like SQL COUNT(), but for the ...
0 votes
1 answer
40 views

Custom fields array to display it monthly

I have an array structure from custom fields inside custom post type like the following: Array ( [webw_employee_projects] => Array ( [January] => 0 [February]...
1 vote
1 answer
1k views

ACF: How to get the full field name (meta_key) by a field key?

In Advanced Custom Fields: Which function can I use to get the full meta key of a field by its field key? So, if I have a field with the name some_field and the field key field_sd54hfs5df: How do I ...
0 votes
0 answers
103 views

Expire Date Condition not Working ACF WordPress

I am trying to Add the Condition if Expire date is smaller than the current date expired in the post. But the condition not working please check the code below. <?php if (!empty($apply_from)) { ...
0 votes
1 answer
104 views

Order category posts by last word of custom field

I'm trying to order a category page by the last word of a custom field that all of its posts have. The custom field represents a name, so the last word would be the last name. In the end, the posts of ...
  • 3
1 vote
0 answers
74 views

Calling the "wp-link-wrap" pop-up modal

When using the ACF, I noticed that the "Select Link" button calls a native modal called "wp-link-wrap". How can I call/access this modal without ACF?
0 votes
2 answers
26 views

hide specific div on single.php [closed]

I've been working on WP since a week so far i've seen bunch of tutorials and videos about wp but i feel stuck and since i'm a wp noob i cant find or think any solution for a simple problem. i have ...
  • 11
0 votes
0 answers
121 views

get_field values for each post on home page using wp_add_inline_style

I can do this for single posts but not on the home page archive. When i add a meta value on the term archive edit screen, i want to use it in the home.php file to target posts in specific categories. ...
  • 446
0 votes
0 answers
63 views

How can I add diffrent editable text fields?

I am new to Wordpress development and created my own theme in php. My problem is, that I don´t realy know how to achieve the following: The website has diffrent areas, where custom text shall appear. ...
2 votes
0 answers
707 views

Print custom field in Query Loop block

I have added a custom field with the Advanced Custom Fields plugin. I can print the content of the field on the post itself using the acf shortcode ([acf field="date"]) without issues. ...
0 votes
1 answer
28 views

Listing posts with a value in a custom field

I read several posts and stack exchange answers but still cannot put the code together to work. I read the post Query posts by custom fields I have posts with custom fields, lets say "publisher&...
1 vote
1 answer
131 views

How To Fix WP Query Returns Results But Shouldn't?

I have a WP Query that should return no results, but instead seems to be returning items. I'm guessing the null result is being interpreted as "return all results" but I'm not sure the ...
0 votes
1 answer
274 views

Custom Taxonomy Search result page

I have a post type named Icons, I have a custom taxonomy named Icons Pack which have a custom field for featured image. Also I have a search form in my site for users to search for the icons they want ...
0 votes
0 answers
139 views

How to get Previous Visited Page Information

I want to Change for Customized my Contact Form based on Previous URL Visited or We ca say I want to Dynamically Change the Values of Contact Form based on Previous URL Visited. So I had searched and ...
0 votes
0 answers
19 views

Add a custom field to my custom post type and then get posts which are before the given date in the custom field

Hi all "Want to do it without plugin" Firstly how can I create a custom field in my custom post type where I can get the date // Our custom post type function function create_posttype() { ...
  • 1
0 votes
1 answer
34 views

Delete user meta but only if found in array

I created a SAVE button that saves a page's URL to the user meta in an array. I'm trying to now create a REMOVE button but I'm finding that when delete_user_meta is used it deletes all entries in the ...
  • 3
1 vote
0 answers
40 views

What is the recommended / best way to do this: Event calendar post/type in a block-based theme?

my question is this: assume I have a php-themed WordPress site with an event calendar page template that's using post type "event", which in turn has a lot of custom fields that hold the ...
  • 21
1 vote
1 answer
313 views

Get posts for which a custom field is not present, with get_posts

I'd like to get all posts for which the custom field hidden is NOT present. This does not work: $postsForSitemap = get_posts(array( 'numberposts' => -1, 'orderby' => 'modified', '...
  • 87
0 votes
1 answer
51 views

get posts based on non-single metadata

I have meta data to custom post "event", registered as non-single, i.e., there is an array od metadata "terms" (it is not WordPress term, I just call it term, it is a record ...
  • 713
0 votes
0 answers
52 views

Creating a custom page post type just like the original "pages" post type using CPT UI

How can I make my custom post type (a page type) using CPT UI? What are the setting I should use? Like I need a custom "pages" section completely separate of the original "pages" ...
  • 101
1 vote
0 answers
130 views

retrieve Meta field value from CPT and set those values as Image Meta Field "Title"

So i have a created a CPT (Car) with custom meta fields (Model, Maker, car photo ..etc) and those meta fields are being filled using a frontend form , all these has been created using JetEngine Plugin....
  • 13
1 vote
0 answers
40 views

Wordpress Rest API to call page data associate with custom meta

I have an ajax rest api called to retrieve certain page data, the call was success but it's come with blank meta, is there any workaround to call api associated with meta data along? var request = ...
  • 11
0 votes
0 answers
20 views

how to find out which plugin disable custom field for post

I tried to enable custom field for my post but it fails to enable. Read about it online that there is an plugin for advance custom field that is causing the issue. But I am not using this plugin. ...
1 vote
1 answer
714 views

Output an array of terms for a 'tax_query' => array()

I'm trying to use custom fields on the backend to set the taxonomies in a WP_Query for a category archive on the front end. In the page template. this gets my categories from the custom field: $terms =...
0 votes
1 answer
22 views

how to skip a CPT element from the pager by custom field

I'm making a template that shows all the users of a CPT Family like this: <?php if ( have_posts() ) : ?> <?php while ( have_posts() ) : ?> <?php the_post(); ?> $...
  • 1
0 votes
1 answer
331 views

How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields

I try to make a sort of fiter for my website. Goal is for the visitors to query results by prices ('prix') and hobbies ('aimerparlapersonne'). Prices are numbers between min and max. Hobbies is ...
0 votes
2 answers
136 views

Posts sortable column not sorting properly for custom field numbers

I have a custom field for view counts that are stored as numbers. I added a Views column, and made it sortable, but they are not sorting properly. The results when I click on the Views column are ...
  • 281
0 votes
1 answer
701 views

WP_Query orderby not work with meta_key

I want to order the post by 'leasenum' in my archive-shop.php. I want to filter the specific 'mall' . The result set is correct but the order is wrong. The orderby only works if I remove the 'meta_key'...
  • 1

1 2 3
4
5
74