Questions tagged [custom-field]
Custom Fields are fields that can hold arbitrary extra information known as meta-data.
1,095
questions with no upvoted or accepted answers
6
votes
1
answer
2k
views
Admin Area Custom Type Search By Meta Fields Without Title & Content
I have a custom post type that uses several meta fields. In the admin area I would like to be able to search by those meta fields. I have implemented this currently in my functions.php with this code:
...
5
votes
1
answer
2k
views
Sorting posts by custom date fields (non standard date format)
I've inherited a website with a post type courses that has a custom field 'date-start', a Date Picker.
Unfortunately the date start is stored as 'ddmmyy' and the ACF documentation implies that this ...
5
votes
1
answer
304
views
How can I append custom data to images in the editor?
I've added a custom meta field to my image details so that a client can add a number to their photos (a design choice). The data would need to show up under each image (like a caption) inserted into ...
4
votes
0
answers
423
views
extend Meta Box / Document Panel
For a project, I'm trying to figure out the best way to implement a checkbox, related to a post type.
What I'm trying to to:
On the final website, there should be a dropdown-button, with upcoming ...
4
votes
0
answers
3k
views
Gravity Forms: Create fields programmatically
Is there any possiblity to create and manage gravity fields dynamically?
I have form with ID 4 with couple fields. I want to add some fields of type checkbox with my own custom external data which can ...
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 &...
3
votes
1
answer
185
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 (...
3
votes
0
answers
187
views
How to save a ToggleControl value in a meta field?
I registered a boolean meta field called _meta_restrict in a custom post type:
PHP:
function register_meta_fields() {
register_post_meta( 'custom_post_type', '_meta_restrict', array(
'...
3
votes
0
answers
1k
views
ACF Upload Image in repeater from front-end with custom form? - add_post_meta()
I want to upload images in the ACF repeater. That repeater means the gallery of page.
Point is to create post in custom post type using add_post_meta() method.
Here I have the form :
<input type=...
3
votes
1
answer
837
views
Revolution Slider Orderby Two Custom Fields
I have create Revolution Slider which load the custom post type, Events. There are two custom fields, Event Start Date and Event End Date. I would like to display order by Start and End date. Because ...
3
votes
0
answers
2k
views
How to edit multiple post with Custom fields
I created a custom field for my post. All sounds good except for the fact that when I try to edit multiple posts (in the same time) by selecting the multiple option in the post list, I only find some ...
3
votes
0
answers
41
views
How do I add custom_meta_box_id's value?
I have added custom meta boxes in post and I want to put Tag slug name in the meta box text field, and want to display the text field's texts (Tag slug name) like following this.
<?php
$my_query =...
3
votes
0
answers
49
views
Change the RSS Publication Date to use a value from a custom field
I have a site that wants to order its RSS output by a date value in a custom field. I'd rather not create a new feed to do it -- how do I override the default feed date value?
3
votes
1
answer
173
views
Function to Download External Images to My Site
I display images on my site from other sites. The URL is saved in a custom field named couv.
I would like to download these pictures on to my site and create a new custom field with the new value ...
3
votes
1
answer
337
views
Using a custom field value to redirect away from a 404 page
I’m moving from an old CMS to WordPress.
The old articles are saved as posts and the new WordPress permalink is %post-id%.
The old URL slug is unique and saved as a custom field for each post; the ...
3
votes
0
answers
877
views
How to use pagination with get_post_meta
I have a Products Page that i am using to add products using custom metaboxes this is the code for my page
<div class="container products">
<div class="row">
<?php
$...
3
votes
0
answers
3k
views
Copying Custom Meta Values from existing post to a duplicate post
I'm trying to revise an existing WP plugin BU Versions to accept different custom meta field values from items I've set-up using the Advanced Custom Fields (ACF) plugin.
BU Versions will copy over ...
3
votes
2
answers
445
views
Extra filed under "About the user" user profile
I use the following to add Phone number,linked id etc Under the "Contact Info" in user profile. Now I have to add a filed under the "About the user". How can i do that?
function my_new_contactmethods(...
3
votes
0
answers
1k
views
Unique key for each row in a repeater field
Is it possible to have a unique key for each sub fields in a repeater field? I don't want to use the array index, because the array index can be changed, when adding new rows between existing rows.
I ...
3
votes
2
answers
6k
views
Displaying Meta Box Image
I have some problems displaying info from my custom meta box in my custom post type single. I'm using Reusable Custom Wordpress Meta Boxes by Tammy Hart.
I'm able to display the textfields using this:...
3
votes
1
answer
628
views
Change post format using custom field
I'm creating a theme using the CF Post Formats plugin. But I've run into some trouble I don't know how to solve. Here's what I want to be able to do:
Create a new standard-format post
Enter a url ...
2
votes
0
answers
702
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.
...
2
votes
0
answers
261
views
ACF won't load from a custom JSON location
I’m trying to set up local json sync with ACF on a multisite installation. It worked with the default acf-json folder in the child theme, but I’d like to save and load everything from the parent theme....
2
votes
0
answers
21
views
How to Identify the Source of a Custom Field?
A Wordpress installation I'm working with has a couple dozen custom fields, including some that contain outdated Open Graph information (e.g., dpsp_pinterest_hidden_images, ...
2
votes
0
answers
344
views
How to extend nav-menu-item-control data in Appearance > Customize?
I have one question as for Nav Menu Items custom fields in the Appearance > Customizer screen.
Since 5.4. there are 2 new hooks:
wp_nav_menu_item_custom_fields - it works for Appearance > Menus ...
2
votes
0
answers
1k
views
Adding a Gutenberg-like custom field on a custom post type
I've googled this a bunch, there's a couple of answers for old versions (pre-gutenberg) of Wordpress but none that I could find for Gutenberg.
Essentially I have a custom post type I added by editing ...
2
votes
0
answers
683
views
Getting yoast title for custom taxonomy
I have created a theme template for a custom taxonomy. The HTML title tag has the yoast title that I set when editing the taxonomy. I want to also make this the title of the page. I cant seem to ...
2
votes
1
answer
853
views
How to add a title field in comments?
Just like WP posts have title and text, I want to have titles to my comments. Now how do I add it and show them above the comment texts like a title.
I need it to have a css name as well.
The title ...
2
votes
0
answers
548
views
Inserting Schema Markup (JSON-LD) Manually with Custom Fields or any Better Ways?
what is a simple and reliable way to insert schema markup (JSON-LD) in my static WP pages manually? My question is not about creating the JSON-LD code, but how to implement it in the WP source code. I ...
2
votes
0
answers
485
views
Support auto-save and revisions for custom fields
I recently read this tutorial about custom fields in WordPress and wrote a simple plug-in to provide a metabox with a set of input fields.
I do not use the Meta Box plug-in promoted on the web site.
...
2
votes
1
answer
644
views
Ordering Posts Type A by Custom Fields of related Post Type B
I'm not sure if this is even possible (also posted to ACF forum https://support.advancedcustomfields.com/forums/topic/ordering-by-custom-field-of-relationship-field-object/#post-62454)
I have two ...
2
votes
0
answers
41
views
How to add a custom field after wp post
I want a subtitle box after the title.
How to show it in the post editor?
2
votes
1
answer
78
views
How to have the right design for a custom post type without accessing themes
I am trying to create a music player plugin for WordPress. Using custom post types, and custom fields, I could make posts that takes a URL and artwork.
The player works based on jQuery and once the ...
2
votes
1
answer
112
views
Which is best in the following scenario : post_meta vs custom table vs parent/child posts
I’m looking for a bit of advice on which way to go with a development question.
I’m building a community site where subscribers create their own private posts. The data they enter falls into two ...
2
votes
0
answers
882
views
How to use max and min values of custom fields
How to use max and min values of custom fields (created via ACF, repeater type)?
For axample, I've custom post type 'auto' and there are a lot of models. Each post(model) has few values of price (...
2
votes
0
answers
2k
views
WooCommerce: update custom fields after checkout validation failure
In my project I'm customizing some of the WooCommerce features.
My "shipping methods" are:
1. delivery
2. take away
I also added a custom field in the checkout page that is a <select> populated ...
2
votes
0
answers
592
views
Custom column sorting in WordPress admin post table
I have made a custom column in user administration panel showing user meta data and registered it as sortable. Made a query action to sort it by the meta numerical value (the stored user meta data is ...
2
votes
2
answers
736
views
Outputting an array of term meta values in a custom WooCommerce tab?
Forgive me – my Wordpress/PHP skills are hilariously rudimentary, so I may not use the correct terminology.
I have added a custom tab to the WooCommerce single product page and need it to display a ...
2
votes
1
answer
2k
views
set and unset the custom field value
While showing all the posts together in admin panel, I have a custom column 'Featured Image'. And this column has a value YesOrNO.
To set the column name : I have inside functions.php:
function ...
2
votes
1
answer
514
views
WP_Query that filters based on custom relationship field
I have two custom post types: work and clients. On the work posts I set up a custom relationship field (client_name) where you can select one of the client posts.
On the work post I now want to check ...
2
votes
0
answers
44
views
WP_Meta_Query causing long-running MySQL queries
I used the following WP_Meta_Query which queried posts for a specific custom fields pair.
$args=array(
'meta_key'=> 'tnid_01',
'meta_value'=>$tnid,
'...
2
votes
0
answers
67
views
Storing data into custom taxonomies VS post custom fields (post meta)
I'm wondering what's more efficient when it comes to performing search for data. I am building a job board where I have an option to store information like:
Company Name (Searchable)
City (Searchable)...
2
votes
0
answers
1k
views
Button inside Custom Meta Box triggering the Update Button
I have a custom meta button that adds additional custom meta fields inside the custom meta box.
This meta box, in particular, gives me a choice to enter a particular skill and rate my own ...
2
votes
1
answer
462
views
Add custom taxonomy under the category title
I've added a custom taxonomy to my product category page in the admin. I can call the custom field using the following:
$queried_object = get_queried_object();
$t_id = $queried_object->term_id;
$...
2
votes
0
answers
195
views
Woocommerce Storefront WordPress Ignore Media Gallery Images and use External 3rd Party Host
OK, firstly we have done this before using Magento and it worked well, but with WordPress? Well, here is the problem and the plan...
The Problem
For a few reasons we wish to use a 3rd Party host for ...
2
votes
0
answers
482
views
Add WYSIWYG to Image Description field
I need to build this thing:
It's essentially an image with a caption, and it can go inline anywhere in the text. I could just create a shortcode for it I suppose, but I'd really like to integrate it ...
2
votes
1
answer
4k
views
Saving custom image meta fields
I have currently added a custom meta field to upload a media file (image). I can successfully add the upload button to display and it works but I'm having problems saving the field when updating the ...
2
votes
0
answers
1k
views
Custom Posts Hierarchy? (State/City/Restaurant)
Question:
What is the best way to create a hierarchy structure (also called parent/child relationships) between custom post types?
For example, we currently have 3 post types: States, Cities, and ...
2
votes
3
answers
242
views
Custom meta fields for specific custom type only
I've got a custom post type curiculum and a metabox that saves a value to a custom field. However this custom field is added to another custom post type (created by an e-commerce plugin) wpsc-product.
...
2
votes
1
answer
324
views
Automatically populate a hierarchical taxonomy from a custom field
I've got a vexing how-to that I've not found any help on. I have a custom post type that has a custom field with a date in it (format: yyyy-mm-dd-t). When a post is published or edited, I would like ...