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
8 views

Posting to a Custom Post Type from front end - user generated content

Is there a fast and reliable way of posting to a Custom Post type from the front end? My use case is for creating a daily checkin for a fitness trainer. I have created the necessary fields using ACF. ...
0
votes
1answer
15 views

How to save multiple values with same meta_key, each value linked to another tag id

Let´s say a user signs up to multiple memberships, each on a different date. User signs up to: Membership A on 05.03.2021 Membership B on 17.05.2021 Membership C on 29.07.2021 I would like the dates ...
0
votes
0answers
7 views

Displaying brands on product page and product grid

I'm starting to create a website with a shop section. On it, I would like to be able to display the brand of the product on the product page and also on the product grid for each product. Is there a ...
0
votes
1answer
13 views

Move the metaboxes to the very top of post editor

I have this function that creates a custom metabox (with the metabox .io plugin), i would like the metabox to stay on top just below the title field this is the code i am using function generator_api()...
0
votes
0answers
14 views

trying to link between 2 metabox

hello i'm using cmb2 to create metabox so i created a repeatable group contain to fields $cmb_repeat_test->add_group_field( $group_repeat_test, array( 'name' => esc_html__( '...
0
votes
0answers
13 views

What is the ideal way to make modifications to an external plugin?

I'm using an LMS plugin known as Tutor LMS and there are certain modifications that I would like to do to the plugin. The way that I thought of originally was quite cumbersome. It involves creating a ...
0
votes
0answers
14 views

Read / Watch / Listen times - meta

I have a website organised around three kinds of posts (categorised accordingly): "Read" "Watch" and "Listen". I want to have a read-time and watch-time and listen-time ...
0
votes
0answers
17 views

Moving a meta field value in a taxonomy

A meta field was created, but it is not so convenient to use it, so a taxonomy was created, now for each entry need to transfer the values from the meta field to the taxonomy field, did this function ...
0
votes
1answer
33 views

Shortcode for Custom Field of Media Attachment (to use with Featured Images)

I'm using ACF (Advance Custom Fields) for Media Uploads to store location information about photos. When I set a post Featured Image to a photo that has this extra field, I'd like to output the ...
0
votes
0answers
13 views

Send acf_form data to external api

i created a user profile using acf_form. This is my base code, if it helps: <?php $options = array( 'post_id' => 'user_'.$current_user->ID, 'field_groups' => array(552977), 'form' => ...
0
votes
0answers
9 views

How to use Wordpress with different content types vs taxonomies and upload the data by CSV so it all relates

Wondering if anyone can help, I’m using Wordpress and Beaver Builder to make a site which is bases on comparing hospitals and their treatments. So I have about 60 hospitals and about 1800 treatments. ...
0
votes
0answers
18 views

Replacing date values in TIMESTAMPDIFF() with custom fields from wp_postmeta

Two days ago I opened a thread related to the command 'timestampdiff()' -> Old thread). I think I've described the problem a litte bit too complicated, so I will describe it easier in this new ...
0
votes
1answer
17 views

Simple custom attributes on posts

I'm working on a site which will have a dozen of menus. There will be a subnavigation widget below the header. My client wants his content writers to be able to select which menu would show up in the ...
0
votes
0answers
14 views

How can I rename a custom field group?

I want to rename the "password managers".
0
votes
0answers
26 views

$wpdb: using timestampdiff with custom fields

friends, sorry for my bad english. I hope, that someone could help me with my problem :-) I'm about to relaunch my website, which serves data of thousands of famous people. In the past i retrieved the ...
1
vote
1answer
35 views

Display custom fields from custom posts in RSS feed

I've been struggling with this for a few days and still can't figure it how. What I am trying to do is to add a custom table field into the RSS feed, so I am using Code Snippets for this matter. Below ...
0
votes
1answer
16 views

Hide a div if the fiels is empty

I have a problem to hide a div when the input of a custom field is empty. This is the code I am using, it's fine when the field is not empty. But when the fireld empty, the div will show. The field ...
0
votes
0answers
10 views

Bulk Update Custom Fields for Custom Post Types

I am using this function which works great in case anyone wants to bulk update custom fields for custom post types (just change parameters as necessary). $args=array( 'posts_per_page' => -1, '...
0
votes
0answers
6 views

Problem how customers will find events happening in their own city and not all the events happening in the whole country

We have several events around a country and we would like to have some kind of filter or something that people dont need to go through events happening thousand kilometers away. How can we do this? ...
0
votes
1answer
30 views

ACF multi taxonomy on filterable gallery

I created a filterable gallery with ACF. My problem is that when I add a project to which I add several taxonomies, in my gallery I have the project as many times as I have added taxonomies. Apart ...
0
votes
0answers
13 views

How to use the Term Object from a custom select field in a query

I have a WordPress site in which I want to show 2 recent posts from a specific category. I want to use custom fields (via ACF in this case) to allow the site admin to choose/change the category ...
0
votes
0answers
17 views

WordPress meta query for serialize associated array meta value

Serialize array value is: a:13:{s:7:"relaxed";a:7:{s:4:"name";s:7:"Relaxed";s:5:"votes";i:377;s:7:"term_id";s:5:"28595";s:4:"slug";...
0
votes
0answers
17 views

Reposition Product Variation Field

I have created a custom field for variable products. I need to reposition the custom field data.variation.custom_field as shown below: https://imgur.com/a/A8aSHbH How can I reposition my custom field ...
0
votes
0answers
11 views

Arrays in custom fields or is there a better way?

I have a poll functionality that uses custom post type & taxonomy to define actual polls. CPT: poll_entity Taxonomy: poll_year Now I need to store votes on user to highlight on voting page. I'm ...
3
votes
1answer
84 views

How Can I save multiple records in same meta key?

I want to save multiple dates in meta key. I have a three dates 2,3,4 and I want to save all these values in same meta key but as a different values. For example: dates(meta key) 2(meta value) dates(...
1
vote
1answer
21 views

Fetch Record based on meta key dates

I want to write a query which fetches the data based on my meta key added. Meta key name is 'repeater'. This is my POST META. Serialized: a:3:{i:0;a:3:{s:9:"postdates";s:10:"2021-02-02&...
0
votes
0answers
21 views

Setting up a cron job to auto update a custom field

I need help to setup a cron job to update a custom field (created with Advanced Custom Field) every 8 hours. This is the function to define the custom time schedule: function cron_schedule_eight_hours(...
0
votes
1answer
11 views

Proceed to the next video of the custom post type but remain on the same post

So I have a custom post type in WordPress that displays html5 videos. Is there a way I could automatically play the next video once it's over and still remain on the same post? I'm thinking something ...
1
vote
0answers
25 views

wordpress allow user to edit user profile with custom fields

I have custom fields on the user profile on the back end that allows the admin user to update a user's profile. Here's the back end. When admin saves the profile these fields show up on the front end,...
1
vote
0answers
16 views

How do I correctly set up a WP-Query to only show upcoming event-posts?

The goal is to display event-posts only for upcoming events. Setup is Elementor Pro combined with Astra Pro theme. I added a custom date field called 'eventdatum' (d/m/Y) to posts and via the ...
0
votes
1answer
13 views

Branch made by several custom values

Below code from function.php works fine when the custom value used for conditional branch is only one. This code means if custom key A is AAA, update custom key B as ZZZ. if(get_post_meta($post->ID,...
1
vote
0answers
8 views

Why do WP_Query results change after updating unrelated Advanced Custom Fields (ACF)?

TLDR - After manually updating a custom post, my WP_Query will change it's sorting order and move that updated post to the end of the array response. I have a custom post type called Events that use ...
0
votes
0answers
24 views

How to sum up custom field values if today's date is equal or greater than custom field value date?

So Far - I have a shortcode [Totaltag tag="8"] that prints the Total Values of all posts that have Number CF and Date CF. The post has many custom fields and two of them are Number (For Eg. ...
0
votes
0answers
16 views

Double-Linked Custom Fields

We’re working on a historic database for an organisation with a yearly list of all board members and their functions. Each person (custom taxonomy) has their custom profile with their bio and extra ...
1
vote
1answer
26 views

Login WP - Connect single field to an external api

I made a plugin to allow wordpress login with external api. Everything works, now what I have to do is that when a user logs in for the first time, the plugin checks to see if it is already present on ...
0
votes
0answers
16 views

Adding and Managing Custom User Fields

I am creating a courses website (similar to Udemy) on WordPress - using Tutor LMS. Tutor LMS, like any other plugin, has its own templates including a user profile/dashboard where the default-...
0
votes
0answers
11 views

Adding custom field to an existing frontend form

I am struggling on this for few days already. Hope anyone can assist me, thanks a lot! The theme already has a frontend form, but I wanna add a custom field on it, which is a expiry date of the post. ...
1
vote
0answers
7 views

How to schedule a custom field value update?

I have created a boolean checkbox custom field using ACF to mark a post as "featured", so it shows up on the homepage slider. I'm trying to figure out how to set up a timer so these posts ...
0
votes
0answers
14 views

Use a custom page with dynamic content as a user profile page

I'm trying to create a website with fully customised user profile pages. I've created the page which uses dynamic content to pull user custom fields into it, this works fine to view your own profile ...
0
votes
0answers
18 views

Add inline styles to core wordpress blocks

I want to add a field to all default / core WordPress blocks so that we can add inline CSS to them. e.g. padding to the 'group' block to avoid the text being bunched right to the edge. The reason that ...
0
votes
0answers
10 views

Being able to link a post to a custom id

I am not sure if this is something I can achieve and if so how to start the approach so am looking for guidance. My site is using am external API json request to gather data for football(soccer) ...
0
votes
0answers
18 views

Show the tag if the custom field is set to “Yes”

Using the following code and shorcode, I display 10 tags in the basement of the site: function getTagListfoot($classes = '') { global $post; wp_tag_cloud( array( 'taxonomy' => 'tags_type', '...
0
votes
0answers
9 views

How to attach images to the post ACF gallery form is submitted from

I have ACF and ACF Gallery Field plugin. I made a custom post type called "albums". In ACF, I made a gallery field called "album_images". Then in Elementor Pro, I made a template ...
0
votes
1answer
24 views

How to improve my non-unique metadata MySQL entries?

I'm working on a plugin for WooCommerce which uses a cpt called Restock. In a Restock post you can enter products ( id ) plus restock. The user can add as many product restock pairs as they want per ...
0
votes
0answers
17 views

Add image description meta

Could really do with some support on this.. So I have a ACF gallery in place. here is my code: <div class="service-gallery"> <?php $images = ...
0
votes
1answer
19 views

How can I use get_post_meta with add_rewrite_rule to build custom permalinks?

I'm trying to change the url structure of my custom post type posts, but It's not working correctly right now. What I'm trying to do is change the urls of my custom post type (Test) posts via ...
1
vote
0answers
33 views

How to add custom metadata text box dropdown to sidebar in Gutenberg editor for all post types

I am looking for how to add a custom dropdown on the right sidebar of the Gutenberg editor. I would like to do this within the functions.php of my custom theme, not with a plugin. The dropdown would ...
1
vote
1answer
21 views

Retrieving category's color with get_term_meta

I followed this tutorial to add colors to categories. However I can't make it work, when I try to use it in my loop nothing happens, I tried multiple versions but none was right. This is what I tried: ...
3
votes
1answer
51 views

searching in custom meta field

I have multiples custom field in a post type. i can save data, update and display, all fine. now I'm doing the search engine. as it is a library, it must be possible to search in specific fields (...
1
vote
0answers
10 views

Visual editor issue by having multiple tiny mce editors in a CPT

I have a custom post type in which I have added multiple wysiwyg editors, when I click on visual, the content of the editor (button, text, title) get inside of the wysiwyg editor.. it's odd. It looks ...

1
2 3 4 5
71