Skip to main content

Questions tagged [custom-field]

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

1,086 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6 votes
2 answers
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: ...
user1117841's user avatar
5 votes
1 answer
319 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 ...
robalan's user avatar
  • 747
4 votes
0 answers
436 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 ...
josias's user avatar
  • 195
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 ...
Kamil's user avatar
  • 403
3 votes
0 answers
510 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....
morceaudebois's user avatar
3 votes
1 answer
275 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 (...
Oox's user avatar
  • 53
3 votes
0 answers
239 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( '...
leemon's user avatar
  • 1,938
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=...
Milosh N.'s user avatar
  • 205
3 votes
0 answers
662 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 ...
Martinus33's user avatar
3 votes
1 answer
916 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 ...
AntTeam Elvin's user avatar
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 ...
Mdev2023it's user avatar
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 =...
Jivan Rai's user avatar
3 votes
0 answers
59 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?
kic00's user avatar
  • 31
3 votes
1 answer
178 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 ...
Guenfood's user avatar
3 votes
1 answer
357 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 ...
Abouasy's user avatar
  • 289
3 votes
0 answers
886 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 $...
Mohamed Mokhtar's user avatar
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 ...
unwrittendevin's user avatar
3 votes
2 answers
535 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(...
MidhuN's user avatar
  • 507
3 votes
0 answers
2k 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 ...
user1149117's user avatar
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:...
turtledropbomb's user avatar
3 votes
1 answer
665 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 ...
Herbie's user avatar
  • 31
3 votes
1 answer
519 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 &...
agent abstract's user avatar
2 votes
0 answers
1k 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. ...
Gabriel Smoljar's user avatar
2 votes
0 answers
787 views

A better way to add a meta box to custom post types

Id like to customize the UI for adding and editing a custom post type such that each custom field is included as a separate input field on the "new post" and "edit post" forms (as ...
yevg's user avatar
  • 31
2 votes
0 answers
29 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, ...
Jim's user avatar
  • 21
2 votes
0 answers
419 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 ...
Nikita Sinelnikov's user avatar
2 votes
0 answers
2k 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 ...
Leonardo Petrucci's user avatar
2 votes
0 answers
784 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 ...
user1889580's user avatar
2 votes
0 answers
643 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. ...
user1438038's user avatar
2 votes
1 answer
762 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 ...
drm10014's user avatar
2 votes
0 answers
511 views

Disable saving posts as draft (make all posts mandatory regardless of the post status)

I have a custom post type for which I would like to disable saving as draft functionality. I don't think about autosave/revisions, just disabling drafts. Only publishing should be allowed. Also, no ...
dodo254's user avatar
  • 151
2 votes
0 answers
42 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?
Tamal Dev's user avatar
2 votes
1 answer
79 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 ...
DannyBoy's user avatar
  • 121
2 votes
1 answer
126 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 ...
Mick R's user avatar
  • 21
2 votes
0 answers
1k 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 (...
Влад's user avatar
2 votes
0 answers
3k 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 ...
j.c's user avatar
  • 121
2 votes
0 answers
596 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 ...
fIshy's user avatar
  • 21
2 votes
2 answers
808 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 ...
ninox boobook's user avatar
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 ...
Istiaque Ahmed's user avatar
2 votes
1 answer
539 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 ...
Bas Bohemia's user avatar
2 votes
0 answers
46 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, '...
Philip's user avatar
  • 103
2 votes
0 answers
69 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)...
TheBigK's user avatar
  • 549
2 votes
0 answers
2k 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 ...
Migs M.'s user avatar
  • 33
2 votes
1 answer
619 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; $...
KimmyBuc's user avatar
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 ...
ipagedesigner's user avatar
2 votes
0 answers
511 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 ...
JacobTheDev's user avatar
  • 1,231
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 ...
rikardo85's user avatar
  • 127
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 ...
Daniel's user avatar
  • 145
2 votes
3 answers
244 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. ...
crs1138's user avatar
  • 291
2 votes
1 answer
331 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 ...
GrabBag-Charles's user avatar

1
2 3 4 5
22