Questions tagged [custom-field]
Custom Fields are fields that can hold arbitrary extra information known as meta-data.
3,690
questions
0
votes
0
answers
14
views
If possible a field ID transfom in a Custom Field?
I have a field with a ID, I need that this field will be or will apppear in Custom Field. If possible with a function copy this field and replicate in a Custom Field.
Thank you
1
vote
0
answers
33
views
+50
How to add a custom field to the comments "Quick Edit" screen?
How do you add a custom field to the comments "Quick Edit" screen?
The code below only shows on the posts quick edit screen:
function tips_quick_edit_fields( $column, $post_type ) {
?>
...
0
votes
0
answers
32
views
WP_Query sort by ACF date field (newest first) with blank dates first
I have a custom date field that is optional. If a date is not provided, the item should be first in the items returned by WP_Query. Example:
1st: entry with no date
2nd: entry with date 1 March 2023
...
0
votes
0
answers
20
views
Query order by a numeric ACF field
I created a query for the custom post type of "departments" the query gets me every department with ACF field "type_of_cetifecate" = "bach" and with a certain category id,...
0
votes
0
answers
12
views
Custom Admin Menu Report for Specific User ID
I've been thinking for generating a custom revenue report for each user ID with an 'author' role monthly, which would be displayed on the backend.
All my online users must be able to view their own ...
0
votes
0
answers
18
views
Get API from external source and save in cutom post type
I am new to this API thing,
I have an external API that contains 345 products. Product fields are feature images, product descriptions, and a few meta fields. I know how to create CPTs and meta fields;...
0
votes
2
answers
33
views
How to include custom fields in wordpress search
As you know WordPress search only look at the post titles and contents, but I want the search to include also a custom field. Let me explain more:
Consider a movie post with the title "Fast Five&...
0
votes
1
answer
10
views
Best way for managing images of ads banners
I started building a custom theme and I have a lot of ads banner image on different pages of the site. But my concern is about slowing down the site's loading speed.
What is the best way to display ...
0
votes
1
answer
22
views
Best performance for use Custom Field in WP
I started building a custom theme and I might need to have around 10 to 20 custom fields for posts and I need to 30 custom fields for theme options and image ads banner, and thinking if this will ...
0
votes
0
answers
10
views
Crop custom image size vs actual size
I need to use specific image size with add_image_size to true using ACF image field and wp_get_attachment_image
From this side, my image is displayed well and resizes well in 175*200.
I would like to ...
0
votes
0
answers
52
views
Extend search query to search meta keys values based on search string
I want to create an autocomplete AJAX search and I'm trying to have it where when the user starts typing, the list populates titles matching that search string.
My issue is in the WP_query, because I ...
0
votes
0
answers
20
views
ACF in radio button cf7
Good morning, I hope I am in the right place.
A customer has asked me to create contact forms with radio choices that have values taken from ACF (Advanced Custom Field)
I enclose a screnn and write an ...
0
votes
1
answer
16
views
Modal pop-up HTML code works on other sites or HTML viewers but not in the custom HTML block within a wordpress page?
I'm not the best at coding, but I've managed to create this html code of a modal pop-up which includes CSS, Javascript, and html... it works in an html viewer or anywhere else except the wordpress ...
0
votes
1
answer
42
views
Set post status to draft after validating post meta values in save_post hook
I have some custom meta values to a custom post type ('event'). The custom post type is displayed in the admin and the custom meta fields are appearing fine. I am using save_post_{$post->post_type} ...
0
votes
0
answers
15
views
Multiple permalinks for a single post from custom field
I'm looking for a way to add additional slugs for regular posts, so that a single post can be viewed from multiple urls.
Example: the canonical post url would be: website.com/foo-bar but I want ...
1
vote
2
answers
41
views
Custom Sort Order for Custom Post Type Taxonomy
I have a custom post type - Demo Tours
And for that CPT I created a Custom Taxonomy - Demo Tour Categories.
Each Demo Tour may have one or more category.
Each category has Custom Field - Category ...
0
votes
0
answers
20
views
Shortcode Displays 2 times
Created the shortcode but it displays twice whenever I use it.
Here is the code:
function blog_cta() {
$blog_cta = '';
$blog_cta .= '<div class="article-cta-box">';
...
0
votes
1
answer
45
views
How to execute a shortcode within a custom field?
I am using a plugin that generates a shortcode to display files from a Dropbox folder. I need to display the shortcode on a specific page, but it will be different for each user.
Therefore I have ...
1
vote
0
answers
25
views
Saving multiple custom meta box fields
So,
I have a custom metabox, with multiple fields on it, and the amount of boxes is variable (could be 3, could be a lot more, depending on order quantity number)
I'm trying to write a save function ...
0
votes
1
answer
27
views
Wordpress does not show the custom fields box
I have created a new CPT in my wordpress locally at the moment, I need it to have custom fields and I have added it so that it does.
the code:
register_post_type( 'centro_de_recursos',
array(
...
0
votes
1
answer
14
views
Update Custom Field daily within 7days
Is it possible to update the custom field daily within 7days?
For Example:
When a user created a new post, inside the post there's a Custom field name Points Earned. I would like to updated the Points ...
0
votes
0
answers
56
views
Conditional display based on ACF checkbox
I have an ACF checkbox sub field in a group field on an options page. It has 4 options, and is set to return “Value”.
I am trying to make a series of radio buttons that correspond to these options in ...
0
votes
0
answers
8
views
One WP website as content source for several others
Trying to think of a solution for such request:
One WP website used as a main content source for multiple others. This website is not a "real" one, it is used as an improvised content ...
1
vote
0
answers
20
views
How do you create a front end form that enables the editing of member-specific custom fields in WordPress?
I would greatly appreciate any help you can provide regarding the creation of a front end form to allow members to edit custom posts that I have created in their admin panel.
I have successfully ...
3
votes
0
answers
29
views
How to add an ACF only for parent term?
the question here is not for the front-end, it is for the back-end. Is there any way that I can add a custom field using ACF that only displays/shows in parent term.
└── Category
├── Motherboard &...
0
votes
0
answers
16
views
How to add new Metadata options (Date, Author, etc.) for Posts?
I would like to know if it's possible and how to create new Metadata options (like Date, Author, etc.) to show about a Post.
I tried using Advanced Custom Fields, but I can't seem to use the custom ...
0
votes
2
answers
43
views
I want to show image from custom field image on my custom page template
I have created a taxonomy and in that taxonomy i have created custom field for image. Now I want to show that custom field image on my custom page template with category name. I have tried much it is ...
0
votes
0
answers
46
views
WP Query Args - search by meta_key or title
How do I filter to get records with titles OR content OR meta keys which contain a part of a string.
If I set meta_values,
$args = array(
'post_type' => KBE_POST_TYPE,
'posts_per_page' ...
-1
votes
1
answer
21
views
custom field value is blank or empty
function add_custom_fields($post_id) {
global $post;
$metadescription = wp_trim_words( get_the_content(), 55 );
add_post_meta( $post_id, 'meta_description', $metadescription, true );
}
...
0
votes
0
answers
14
views
acf field repeater link don't work
I am trying to make an acf repeater field with the link field.
I don't understand why I get an error message:
"Warning: ltrim() expects parameter 1 to be string, array given in"
Here is my ...
0
votes
0
answers
28
views
Can running a WP-Cron to update_post_meta cause performance issues?
I'm counting post views on a custom field inside wp_postmeta, the update happens each time a user interacts with the post.
I was reading at this response Will a large postmeta table slow a site down?
...
0
votes
0
answers
13
views
How can I change the location where the custom field is displayed in the Quick Edit tab in WordPress
That's my situation right now:
I want to display my "Artist" custom field under the "Slug" field, with the same HTML structure. But how? Example:
The following code may help:
// ...
0
votes
0
answers
14
views
How do I organize posts based on their taxonomy?
I have a huge assortment of posts. They each belong to a taxonomy (let's say Taxonomy 1, Taxonomy 2, Taxonomy 3, and Taxonomy 4).
On the page where they are displayed - I wanted them to be displayed ...
0
votes
1
answer
159
views
Convert custom field date format to "Wordpress default"
Hello ladies and gents,
I'm using F j, Y (e.g. December 28, 2022) as default date format on my site (set in the admin settings). I have an event custom post type with an event_start_date custom field.
...
0
votes
1
answer
56
views
Change Post status based on custom field date +1 day
I have a working script to "expire" a post based on the data of a custom field. The post "expires" (status changes to a custom status archived) on the same day as the ...
0
votes
1
answer
47
views
Add CSS class to posts with certain meta key
I am working on my header navigation and I want to underline the menu item for certain conditions.
I would like to add a CSS class if
the post has the ID 21638, or
the post has the meta value 'bloom'
...
0
votes
0
answers
22
views
Sort CPT by taxonomy AND THEN by custom field
I am trying to sort a CPT first by Taxonomy (tag) ASC and then by custom field (last_updated_hc) DESC which is a date-picker field. Using posts_orderby I can sort by taxonomy but I am running into ...
0
votes
0
answers
21
views
WP Query + custom fields: How to query event posts from the current date backwards 6 months and organize it month by month?
I am having some trouble figuring out the logic of this query and what I need to do to make it work.
I created an "Event" custom post type, and every Event post has a date value coming from ...
0
votes
1
answer
22
views
Set new url from custom post field
I've create a new custom post type "Event". I've added a custom field (Post Object) to the post type "Post" were you can select the corresponding Event.
So I create post new post ...
-1
votes
1
answer
19
views
Post object GUID adding http:/
In my template I have href="'.$package_link->guid.'"
The resulting HTML is: href="http:/package/download-2023-friday-arrival-monday-departure-weekend-coach-festival-ticket/"
Why ...
-1
votes
1
answer
57
views
Is there a way to read JSON data inside Custom Fields without editing PHP? [closed]
I have a post with Custom Field called json_data, inside there is an array of strings such as: {"data":["string no 1","string no 2","string no 3"]}.
Is there a ...
0
votes
1
answer
122
views
Displaying custom meta box value in a custom post page
I have an issue with custom meta boxes in a custom made plugin.
In fact, the task is simple, but I am new in this field. I made a plugin that allows user to enter the movie title in a custom meta box. ...
0
votes
1
answer
20
views
How to initialise WP_Query on the basis of a specific meta_value and continue iterating rest?
I have a CPT with daily deals, I need to show these daily deals on my frontend as per today's day.
For eg, if it is Thursday : The returning array should return Thursday, Friday, Saturday, Sunday, ...
0
votes
0
answers
19
views
Can I log the searches that are returning 404 in the DB?
I would like to log every single search query for which one gets 404. For example, if I search Cat in the search box, but my website doesn't have any content as cats. I would like to log that "...
0
votes
0
answers
16
views
WP_Query – order with usort by custom meta
I have a custom post type location which has different categories (e.g. museums, theatres, shopping) and I want to output each of these categories and order within these categories by distance which ...
0
votes
0
answers
35
views
Insert a custom field as a second email address to a completed order in WooCommerce
I'm looking to use a custom field from "Checkout Field Editor for WooCommerce" to use as a second email address to a completed order in WooCommerce. I started by using this code which works ...
-1
votes
1
answer
26
views
Is there a plugin or another way that can help me find out the underlying files of a page/post? [closed]
I have a WordPress website, developed by someone else. I need to make some changes and fix some issues, as the site still has some flaws. For example, there are some fields that need to be changed, ...
0
votes
1
answer
156
views
querying to custom field over ACF REST API
Iam using the "ACF" plugin with "ACF to REST API".
I found a solution for querying a custom field over REST API.
I inserted this into my functions.php:
add_filter( 'rest_{type}...
0
votes
1
answer
223
views
Is it possible to specify a time interval (from, to) in ACF with date picker, or other custom field?
I am working on an online magazine in WordPress PHP (with Advanced Custom Fields plugin). I specify the date of the article's publication with 'date picker' field. Even though for articles ...
0
votes
1
answer
43
views
Render CMB2 select option to post page [closed]
I'm using CMB2 plugin to add select metaboxes into a post. The metabox work fine on the post editor.
But failed to render and displaying on post page.
The code for post editor
add_action( '...