The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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

How can I match multiple CPTs in one row in mySQL?

I would like to start a query in the WordPress mySQL database where I connect several CPT's with each other and output them in one row per service CPT. mySQL example:http://sqlfiddle.com/#!9/2ed83c/3 ...
0
votes
1answer
25 views

Wordpress colorpicker save both hex and RGB

Trying to get both the hex and RGB value of a color from the native color picker in Wordpress, user chooses the color via a custom metabox in the admin. Just need to save both values as meta for re-...
0
votes
0answers
17 views

Problem in moving cpt's from local website to live website

I've made a custom post type, designed a custom page template for it and tested it on the local server. I've copied those custom post types to my live website. On live website it is pulling custom ...
0
votes
1answer
34 views

Save custom field on WP_List_Table

I have a custom field which is named clicktripz_object_location. I've created a WP_List_Table with the following code; if(is_admin()) { new UCO_Wp_List_Table(); } /** * UCO_Wp_List_Table class ...
0
votes
1answer
12 views

WP meta_query args not working in function

I have three query args for filtering posts in grid. By Author and Status works fine, but ACF meta_query not work. I setup field as select: http://prntscr.com/pi6m66 I need when is selected "Ne" ...
0
votes
1answer
15 views

Should Custom post types and fields be in the theme files or in a custom plugin packed into the theme?

I am trying to create a Custom Premium WordPress theme for a Travel Agency. I am thinking of finishing the theme and submitting it for review. I want this theme to be really useful so I ended up ...
1
vote
1answer
19 views

How Meta Data is different from Custom Fields of POST/PAGE in WordPress

I am really looking forward to have a clear picture of Why Meta data is being used for the Posts/Pages? I have always been wondering on how Meta data is different from the Custom Fields of Posts. I ...
0
votes
0answers
14 views

How To Append Buddypress's Extended Profile Fields to Profile page?

I have made a WordPress website that specializes in registering users. So I wanted more profile fields to register more user data, so I used BuddyPress's. The problem I have is when I want to ...
-1
votes
0answers
17 views

How to save $_POST['acf']['field_X'] data from a custom form?

I have a User Submitted Posts form in which I've included my ACF field group. $_POST['acf']... includes data submitted via form and with USP filters I can hook into newly created post/article which ...
0
votes
0answers
23 views

How to save fields with elementor into Custom Post Type created by me?

Im working on a project where Elementor('no-code-feelings') is a pre-requisite. So, what im facing: 1st) i've Created post type named lp_item with 2 custom fields: lp_item_a and lp_item_b; 2nd) i've ...
0
votes
0answers
14 views

Using date stored as custom field to order posts

I have a custom post type "travel" and a custom field "data" (date format j F) and I would like to see all the posts in order by the custom field "data". I think I have to transform it into timestamp ...
0
votes
1answer
25 views

query posts custom field calculation value

I have a front-end form whereby users create a post and input 3 numerical custom field value` as part of their post. These 3 custom fields are then calculated and the result is displayed in the post....
0
votes
1answer
16 views

Add image to menu item with AFC

I'm trying to add an image to menu item, can't get it to work. Here is my code. header.php <?php wp_nav_menu( array( 'theme_location' => 'side-...
0
votes
0answers
55 views

Is it possible to add Term Meta Fields to a WooCommerce Attribute?

Is it possible to add Term Meta Fields to a WooCommerce Attribute? I know I can do this with regular categories, but I'm wondering if there is a way to do this with product attributes. (without a ...
0
votes
0answers
34 views

Adding a drop-down (select tag) option under Menu Settings in WordPress Admin

I looked (surfed) around a lot to get idea of how can I add custom field/drop-down under "Menu Settings" in WordPress Admin. I want a select tag with options from which I can get value based on the ...
0
votes
0answers
11 views

Adding Check Button On Posting Section On My Theme Wordpress

would like to add a radio button on my theme to appear on posting section why i need it am using custom filed to show a specific post on my blog and adding the metas every time am posting is hard ...
0
votes
0answers
31 views

Add custom field in admin ( edit.php )

I want add another box in edit.php side of search box. I googling for it, but not found anything. How I can?
0
votes
1answer
22 views

Enable Custom Fields For Custom Post Type When CPT Created Using Plugin

My CPT is created using a plugin so i cannot edit the supports parameter to add support for custom fields. I tried using this code however it doesn't work either add_action('init', '...
0
votes
1answer
39 views

How can I fetch all the dates from custom fields from various different custom post types and show / list them at one place in ascending order?

I am using wordpress and pods for building a web app. I have created different custom post types like "project" , "task" and "material" and each of them have various different custom date fields. I ...
1
vote
1answer
38 views

How to access custom order item meta data from a meta key in WooCommerce?

I'm trying to display some custom meta data that's associated with the shipping on an order in WooCommerce. Here's the entire story of what I'm doing (so it might help someone else, and so you know ...
0
votes
0answers
31 views

Get All Custom Field Values from a Specific Category and Store Them in an Array

I added a custom field (location) for some posts. I want to get all the locations from posts from a specific category and store them in an array. I am using the following code to get all the values: $...
1
vote
1answer
42 views

Advanced search by two criteria - sort by location and date (ascending or descending)

I have spent a couple of days working on this and I am still not able to figure it out. I am trying to make advanced search filter that sorts posts from a specific category on two criteria: location (...
1
vote
1answer
16 views

How to toggle between two custom fields in WordPress woocommerce 'WC Product Field Group' plugin?

I have a full suit tailoring WordPress website and it using woocommerce plugin. I need 2 custom field groups to show in single-product page. Custom Measurements (Precise) In this method the client ...
0
votes
0answers
20 views

Add custom fields to search wordpress

I'm using the code below to be able to search using custom fields, which works perfectly but has problems with live search. function cf_search_join( $join ) { global $wpdb; if ( is_search() ) ...
0
votes
1answer
27 views

register_rest_field update_callback don't work for $_FILES

I try to insert a post with REST API who contain text and image in one api call. My image is an acf field. I register my field like that: register_rest_field( 'project', 'logo', array( '...
0
votes
0answers
12 views

How to update user_meta_data from frontend

I want my user to be able to choose if they are a company or individual I've made a user_meta_field in database and it works fine, but how do i make some sort of option on my page-profile.php template,...
0
votes
1answer
28 views

What requirements for ACF custom fields key and name properties?

I have the ACF custom fields plugin and I am using acf_add_local_field_group to register custom fields via PHP. When creating a field via PHP I must provide 3 properties: key: ACF unique identifier ...
0
votes
2answers
16 views

How do you output an unknown number of images in a custom post type with desired markup?

I'm working on a theme that will have an image gallery within a custom post type. I'm able to insert them into the post (using Advanced Custom Fields and embedding them in a WYSIWYG box) but I was ...
0
votes
1answer
10 views

How do i call up default post title in custom posts

anything i put after <div class='article-content'> displays as a text on the front end instead of calling up the original post title add_filter( 'the_content', 'prefix_insert_post_ads' ); ...
0
votes
1answer
31 views

Query custom post type and custom field by URL parameters

I have a custom post type staff. and a custom field alphabet for posts in that post type. Each staff will be assigned to a letter either A or B ... Z based on the first letter of the staff's name. On ...
0
votes
0answers
19 views

WP query custom search by meta query nested ACF repetear field Group > Repeater

So I have searched the web but didn't found quite an good solution to this problem. I am having nested ACF field with a repeater inside a group and I want to display and order wp query by that item ...
1
vote
1answer
15 views

Get a list of posts with associated meta_value

Recently I began to use the Custom Fields. I would like to display a listing of posts which contains the meta_key "oldtimer" and also get the corresponding meta_value. Here is the expected result: &...
0
votes
0answers
19 views

Filtering posts by ACF meta query

I am trying to filter posts by a meta_query, based on a post field. The field type is checkbox. The field configuration is: acf_add_local_field_group(array ( 'key' => 'group_5a579h8fs9a98a', ...
0
votes
0answers
16 views

Output Custom fields in table with Shortcode

Sory for the complete newbie question but after 2 days struggling: I have made a custom post called cars in Worpress with a plugin that adds numerous specs for cars that are for sale. The specs are ...
0
votes
3answers
35 views

Getting posts by custom field value

I need to get posts with a price less than or equal to for example '1000'. The price is set in an arbitrary custom field. Trying to posts a price that is less than or equal to 1000 $posts = new ...
0
votes
0answers
18 views

custom fields update to 5.8.3. removes all custom field data

There is an update for the custom fields. I have version 4.4.12 and want to update to version 5.8.3. It says the compatability is supposed to be 100%. However, when I do the update, the data for the ...
0
votes
1answer
36 views

Custom Field Repeating When Using foreach

I'm trying to display user avatars by login user name using custom fields like this - And here's the code - function user_avatar() { $name = get_post_meta( get_the_ID(), 'user_name', true )...
2
votes
2answers
32 views

Saving repeated option values in a custom query

I have a custom Submenu page with my post type in which I am querying all posts and adding custom textareas and dropdowns that will repeat with each entry. The id and name for each field is the same ...
0
votes
1answer
23 views

Creating an archive page or simple template to list all values of a custom field of specific post type listing

I have a custom post type named 'lawyer' and it contains various custom fields. two of the custom fields are 'state' and 'city'. i want to create a archive page or simple page(anyone will do) which ...
0
votes
1answer
25 views

trying to add extra field using hooks

I am trying to add an extra field on the backend menu of Edit Subscription menu (SUMO Subscription (plugin) -> List of Subscription -> Edit Subscription) I am sending you a screenshot for where ...
0
votes
1answer
19 views

Order posts by meta key ( Using ACF )

Hey I am using ACF in media library and want to sort media by meta key (that is actually created by ACF). BUT it is not working. Here is the code: $gallery_imgs = get_posts(array( 'post_type' ...
0
votes
1answer
17 views

Where is get_post_meta value located?

I'm working on a wordpress website created quite long ago. In the header file I see the following code: <?php query_posts("page_id=63"); while ( have_posts() ) : the_post() ?> <?php echo ...
0
votes
1answer
23 views

User Meta Value not echoing despite Var_Dump Showing correct string

I am going absolutely insane with this one, I cannot for the life of me figure out why I am not receiving the string content. var_dump is outputting the correct result perfectly, yet the content for $...
0
votes
1answer
29 views

How to pass multiple custom fields as shortcode's parameters

I'm learning how to pass parameters in shorcode, I know the basic step after read through WP Codex. But for now, I have plugin come with custom fields and as the title, I want to know how to do it. ...
0
votes
1answer
23 views

Can't set custom meta fields for a post

I am trying to add some custom meta variables to a custom post type, but I can't see the new variables when I dump a posts meta data, and I can't access it in Here is the post definition from my ...
0
votes
2answers
30 views

Get data from PHP to JavaScript to set position of each post on front page

I've created a custom post type called project for my Wordpress theme, which works fine. Each project has several custom fields, including a set of x and y values that indicate where the project ...
1
vote
1answer
38 views

Custom Meta Field - Remove comma from string with str_replace

I have a website that display car/vehicle listings. Each listing displays the PRICE. The price is set as a custom field on a custom post type, that is set to a string data type. The user typically ...
0
votes
2answers
32 views

How to update a custom field in all posts with the value of another custom field in the same post?

I try to get the value of the source field 'enddate', save it in the variable $enddatevar and write it in the target field 'promote' in the loop by activating the plugin, but the code I added to this ...
0
votes
1answer
33 views

Sum All the Post Meta of Published posts of Current Logged in user

I found the below code to count post views in WordPress. I needed 2 things from this, which I am not able to do yet. Author stats: How to show the current logged in user, the total views of all the ...
0
votes
1answer
26 views

Saving Custom Field that includes Quotation marks

I have created a custom field in woocommerce that needs to be saved as 10"x10"x10". This is a measurement and needs to have the double quotation marks. I will display this in a custom tab on the ...