Questions tagged [custom-field]

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

0
votes
2answers
16 views

Make the checkbox meta field checked by default

I have created a page for plugin. For that page i have added a checkbox meta field. The field is working fine. By default, the checkbox field is unchecked. I mean at first to active the plugin, the ...
0
votes
1answer
29 views

WP ForLoop to compare meta information of posts to determine what post to display

The short of what I am trying to do here is: I want to display only one post based on a date stored in a custom field. I only want to display the post if it meets two conditions 1: The date needs to ...
0
votes
1answer
27 views

ACF: Hide a div or template section when a custom field (in a field group) is empty

I am currently trying to get a div or section of my template to hide or not display when a custom field on the backend is not filled in. The problem is, what works for single custom fields that are ...
0
votes
1answer
18 views

WordPress loop by meta key that is an array? and how loop multiple arrays

How can I get loop of posts by meta values that save in a meta_key that is an array like that $sharedHosting_plans_fields = Array ( ...
0
votes
1answer
11 views

Query a Custom Post Type using SELECT that has ACF fields to compare dates

So I have a CPT called ads that has ACF fields of ad_start_date and ad_end_date. I am trying to write a custom WP query using a SELECT statement instead of using WP_Query because I am return an ajax ...
0
votes
0answers
24 views

How to create a A-Z glossary

I am working on a plugin that lists all the available sites on our multisite, I have it working but was trying to find a way to navigate by letters or just create an A-Z glossary. <?php function ...
0
votes
0answers
7 views

Sub user management / administrator able to see related users

Ey guys, basically i have been looking for a way in which i can allow a specific user role / administrator to list and manage only it's related users. Im not 100% sure in how to make it. Ive been ...
0
votes
0answers
25 views

How can I update all product data in woocommerce based on the attribute selected or variation selected?

I want to update the woocommerce product page based on attribute selected. Normally it just shows the parent product info. So i am looking to update the data such as such as title, description, ...
0
votes
1answer
12 views

I want to create a metabox under custom taxonomy

I have a custom post type and A custom Taxonomy under the post type. But I want to add a metaboxes under the custom Taxonomy. My code is not working, Please can you help. Working Code // Register ...
0
votes
1answer
20 views

how can i show WordPress custom field data to my short code?

I want to pull Sub Heading text using WordPress default custom field? i use this shortcode. but not showing any text? //Shortcode: [lplist catname="" lpimgbg="" lpcatheading="" lpbtnurl=""] function ...
0
votes
0answers
10 views

Populating state dropdown with default country [closed]

I am trying to add custom field related with city/state content to user info editing page at admin interface. There is already same structure to obtain this as default in multi-level hierarchy, after ...
0
votes
0answers
45 views

Custom Fields not working properly

I want to add custom fields, phone and address, in front end of my website. I've read this question : How do I add a field on the Users profile? For example, country, age etc . I typed this code ...
0
votes
1answer
15 views

Delete a custom field in mysql for all posts with specific category id

Delete a custom field in mysql for all posts with specific category id I am trying to delete all custom fields with the key 'key1' from posts that are in category id '66'. I can delete all custom ...
0
votes
1answer
16 views

Create new Taxonomy, add extra fields, register terms AND extra fields values?

I need to create a new Taxonomy (nbateam), add extra fields to this taxonomy ('code', 'color', ...) AND register them when the plugin initiate. For now I'm able to do everything except register ...
0
votes
0answers
11 views

Adding date picker to WooCommerce downloadable products section

My problem is to "Add a datepicker with downloadable products in woocommerce" I'm attaching screen where I want to add it. What I've done so far: I tried ACF plugin and many codecanyan plugins to ...
0
votes
2answers
51 views

meta query multiple values for the same key

I'm trying to query wordpress with multiple values but it looks like it can't take no more than 4 keywords I'm currently using a loop and I already tried to switch to a IN operator but I need the ...
-1
votes
0answers
18 views

WordPress post views per location

I've been working on a WordPress theme that allows users to add a custom post type from the front end. I'm working on a new addition to the site with Chart JS, where my users can see statistics about ...
0
votes
1answer
24 views

per blog metadata for plugin

I wish to have my plugin store metadata for each blog in a network (or just one if single site install). Most of the Google results are for post_meta and user_meta but I really need site_meta which ...
0
votes
0answers
12 views

How save gravityforms image (uploaded) to acf field?

I created custom field for post type next i designed form with gravityforms for submit post. User fills the form and send it. All custom field (like text box and other) worked except gallery's field. ...
0
votes
0answers
13 views

Commas in meta fields when saving or updating posts via the API

I'm saving and updating posts via the API and running in to an issue where any post meta that has a comma in it is getting split up in to multiple meta items. An example would be a post with a meta ...
0
votes
0answers
14 views

Set custom post type posts as children of all pages

I'm sure this is possible, but I can't seem to get my head around the best way of setting this up. We are building a website that gives each of our clients a video library page. The videos are stored ...
0
votes
0answers
19 views

Problem with multi checkboxes value in metabox?

I'm a beginner and I have a problem with a part of the script that I found in a post. Practically when printing the checkboxes it does it outside the table. I can't bring the content of the foreach ...
0
votes
1answer
13 views

How can I register multiple custom post fields to json?

sorry if this question has been asked before. I have a few custom fields created with ACF and I am trying to push these fields to json, to use them in a js file. My code looks like this: function ...
0
votes
0answers
16 views

How to set value for a Custom Field from Add Media panel in Wordpress?

In Edit Post page, I'm adding media from Add Media panel by clicking on "Insert into post" button. I'm trying to feed a Custom Field with the URLs from those selected images, but it is not working. ...
0
votes
0answers
20 views

How do I bulk upload csv file containing Custom Text Fields data?

I'm creating an online store with WooCommerce. I have 2000 products that need up to 5 custom text fields so customers can personalise before adding to cart. All products are already on the site. I ...
-1
votes
0answers
19 views

How to add and display custom data on Woocommerce Product single pages [closed]

I just start creating new online GameShop based on Wordpress and Woocommerce plugin. I am wondering if there is any way to add custom meta data like genre (Action,Fps,...) and game developer(Activison,...
0
votes
1answer
23 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
2answers
40 views

How to copy data from a custom field to the post_content?

i used ACF to store post data in custom fields. i'd like to copy the data from a wysiwyg field to post_content into wp_posts table. How can i do this? Roughly: data is on wp_postmeta table, where ...
0
votes
0answers
22 views

Extend Woocommerce search by custom field value

From what I see, the Woocommerce search engine searches by the title and the content. I would like to add a search by custom field value I have read many posts with a similar problem. A lof of users ...
0
votes
0answers
56 views

How can I update custom fields via REST?

Is there a way to update a value of an existing custom filed on a custom post type in WordPress? By a request URL, or webhook or somethings like this? My case: I have a custom post type named ...
0
votes
0answers
19 views

Weird custom fields data lost

I'm experiencing a weird issue with my WordPress. I'm around this for almost two months. Can someone please help me? Please be my life savior... The issue: When I publish a post with data in all ...
0
votes
0answers
13 views

Getting custom field dynamically from variable

I feel like this should be relatively easy but for some reason I'm lost. I'm trying to access an associated posts ACF repeater field based on what row is being outputted. Here's the query in ...
0
votes
0answers
27 views

Update button not working on some posts

For some reason, some of my posts will no longer update. The button is there, but clicking it does nothing. It’s only certain posts. It is a custom post type with custom fields, but posts under the ...
0
votes
1answer
16 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 ...
0
votes
0answers
33 views

Meta Key array building with multiple input values from fields

I'm trying to build a custom form using UserFrontend on wordpress and I need to copy an array from one of the known meta keys from WooCommerce. Only thing is I'm not sure how to approach this issue as ...
0
votes
0answers
15 views

Trying to retrieve meta values from three different meta keys and display in rows

I have the same problem is outlined here: How to display multiple Post meta_key/meta_values by SQL query The final comment does provide the correct result, but only ever displays one row because it ...
0
votes
0answers
31 views

Load default image on button click via AJAX

I'm trying to load a default image into a custom field on button click using AJAX. I've created a CPT and assigned some custom fields using ACF to the CPT. One of the fields is an Image field to ...
0
votes
1answer
79 views

WP_QUERY with group by with custom fields

I need to use group by in my posts with a custom field "eventMonth" that will have values like "April-2019" - "June-2019".. (I never used the wp_query with a meta_query data so...). I've the next ...
0
votes
1answer
26 views

Query post by Category and custom file (ACF)

Well, I try to create a query that will only take posts if the conditions are met, Must be in this category (Event) and have the selected type (News-checkbox). First I asked on the ACF forum but the ...
2
votes
1answer
33 views

Gutenberg Custom Block

I am trying to create a custom block for Gutenberg. So I tried something simple as this: JS File: var el = wp.element.createElement; wp.blocks.registerBlockType('test/blocks', { title: 'Test ...
0
votes
1answer
62 views

How to Sort by Date When Using d-m-Y Format

This question is pursuant to the following - How to Sort Custom Field Admin Column by Date I'm attempting to add functionality to sort a custom post admin list column by a date manually specified in ...
0
votes
0answers
15 views

What is the enclosure filed and what are its benefits?

When I have a publish a post with a video on it, the enclosure custom field applied. Is it important if I delete them from the database?
0
votes
0answers
14 views

Can I make a certain table appear based on conditional logic in a field?

So here is the situation. I am making a website that sells a certain service (don´t worry, nothing NSFW). Now I am given a following request: to make a page with a single field that asks for a ...
0
votes
0answers
22 views

Store comment form custom field in custom database

I'm trying to add custom field created on comment form to custom database. But my solutions not working. How to change/improve it? I add custom fields this way: function add_interests( $fields ) { ...
0
votes
2answers
34 views

wp_editor in add_meta_boxes does not show gallery

I have added a meta box in the page edit section: add_meta_box('custom_section_box', 'Sections', array($this, 'section_box'), 'page','normal','high'); Within the box, there is a wp_editor call: $...
0
votes
2answers
60 views

How to Sort Custom Field Admin Column by Date

I have a WordPress website with a custom post type called 'Courses'. On the WordPress dashboard page listing each course I've added a new column displaying a custom field, which is a date, called '...
0
votes
1answer
29 views

How enter custom post meta or custom field on box post list archive page?

I ask a question that I think many people are interested in knowing the answer. What I really can't do with wordpress is to insert custom meta or dynamic custom fields into the post boxes (on the ...
0
votes
0answers
34 views

update a custom field with the value of another existing custom field

I am trying to write a function to copy the value of an imported custom field (postalCode) to another custom field (wpcf-adres) when the post is saved or created. But i cannot get it to work, so there ...
-1
votes
2answers
54 views

Retrieving custom field as shortcode

I have added a custom field to my site called "dansk_url", to which a link to the version in Danish (different domain) will be entered. I would like to be able to output this as a shortcode to add ...
0
votes
1answer
24 views

How to I change the value of a custom field on the home page?

I'm new to WordPress and have inherited a site that uses Custom Fields. In header.php there is; <?php if(is_front_page()) : ?> <div class="row"> <div class="col-md-4 header-...