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

learn more… | top users | synonyms (2)

0
votes
1answer
2k views

How to add upload field in a custom taxonomy?

I have a custom taxonomy and I want to add a custom field inside , OK that's seems to be easy but the hardest part is when I want to add a file input type the enctype="multipart/form-data" I ...
3
votes
3answers
43 views

Custom user avatar in the Wordpress users listing

By default, Wordpress uses Gravatar for user avatars. I've created a custom field for avatar uploads, and I'm using this as users' avatars on various pages in the theme. In the admin - on the all ...
1
vote
3answers
1k views

Add custom field to existing meta box?

First off, I have been able to successfully implement custom fields within a custom meta box in Wordpress. I understand how this works. My question is, is there a way for me to add a custom field to ...
0
votes
1answer
595 views

SQL / wp_update_post: change post custom field to CPT post taxonomy

the setup is as follow: I have posts with a custom field: actor = 'tom hanks' for advanced management I created a custom post type (actors) and added "tom hanks" as a post within that actors taxonomy. ...
3
votes
1answer
50 views

Right way of storing large number of custom post fields

On one of the sites of my multi-site network; I'm creating a custom post type 'Events'. Each of the 'Events' post will have about 30-50 custom post fields - because we require event creators to enter ...
0
votes
2answers
455 views

Adding and updating repeating custom field meta data

I've got 20+ hours into this and could really use some help. Here is what I am trying to do.. For each record, add post meta. If the post meta already exists, update each field in the array. Just like ...
0
votes
1answer
15 views

Save all custom field data into one “master” custom field

Let's say we have three custom fields: Pirates Robots Ninjas Maybe we're saving information about different people who are related to a post in each of those professions. What I'm trying to ...
0
votes
1answer
23 views

Avoid another meta box in my custom post type

I created my own custom post, all right up here. I have also added the meta box for custom post. But I've noticed that some plugins automatically add their own METABOX my custom post type. This can ...
0
votes
1answer
519 views

Implement Autocomplete for a custom field on Wordpress Plugin Frontend

I've setup my plugin to be used on the frontend using a shortcode. I have managed to use an autocomplete form on a previous website I programmed from scratch (not WP based) but I don't understand how ...
0
votes
1answer
31 views

Add custom field to attachments in a specific category

I have a working function that adds a meta field to all attachments (so I can enter the url of a video). I would like this field to populate only on attachments in the "video" category. I've tried ...
0
votes
0answers
11 views

How can I reduce and update the list of available custom fields in the Name list on the page in admin?

So on the admin page for a certain wordpress page, I want the custom fields list updated, because I don't need some (most of them actually) of the existing values for custom fields. So I want some ...
0
votes
1answer
787 views

Sort posts by custom fields value using dropdown menu

I'm trying to sort my posts by a custom field value, called price. Only using numbers in the custom field value. I want that the visitors of the website can sort the posts on price by using a dropdown....
0
votes
2answers
460 views

Include custom fields into the content of a regular page

Here's my setup: Parent "Gallery" page: _regular page, not custom type or anything _ Several "Project" child pages (could be as few as 1, unlimited number): also normal pages Child pages will ...
0
votes
1answer
495 views

How to sort category by custom field value

I am using the following : $catargs = array( 'meta_key'=> 'category_custom_order', 'orderby' => 'meta_value_num', 'order'=> 'ASC', ); but I can get the ...
0
votes
2answers
2k views

Get image post ID in media upload

I am developing a plugin that adds a Custom Post Type to my theme. It's a retail directory and the post type is a retail listing. Everything is working fine. I can upload content to the DB and then ...
7
votes
1answer
87 views

Development of a Wordpress Search Plugin - Best Practices

Searching for around two days to find an answer to my question, I finally registered for this StackExchange. :) My Question is not simple, so I need to start at the very beginning. But to give you an ...
1
vote
2answers
85 views

how to set default value for checkbox in wordpress

I am facing a problem to set default value for the checkbox field in WordPress. I have a checkbox input field (metabox) in a custom post. I want the checkbox to be checked by default. and if user ...
3
votes
1answer
19 views

Custom field value based on other custom field values

I have a custom field value called points. Post 01 points = 5 Post 02 points = 10 Post 03 points = 8 I need to create another custom filed value called rank. Rank custom filed value should be ...
1
vote
1answer
19 views

Customizing user data

For a school, I'd like to add custom fields to users, such as department, curriculum, date & place of birth, education, phone number, social links.... How can I accomplish this? I see there are ...
0
votes
0answers
20 views

How to update Update click count in user meta

I have a custom code which updates count when someone click on each user link. Here is the code HTML OUTPUT <div class="grid-item grid-item--width2 user-img-32" rel="32"> <a href="https:...
1
vote
2answers
468 views

Bulk edit custom excerpt text in WordPress

Is there a way to bulk edit the custom excerpt text without going to each post and open it? When we have 300 posts it can be a very time consuming process.
0
votes
2answers
1k views

Why am I getting a “Call to member function format() on a non-object” error?

I am trying to add a hook to post saving using WP Frontend User When the form saves and the post is created within the "save_post" function I am trying to find the value of a custom field "...
0
votes
1answer
32 views

Creating Ordered Query using Meta_key

I've hit a massive roadblock that I've been stuck on for days now, hope someone can help with this. The problem: I have a custom field called order_value with the values road, air and bus. I am ...
0
votes
1answer
496 views

get_post_meta fields don't show up on posts page

I'm new here, and to coding! I've been working hard (so, so hard...so hard) to create my website and with occasional help I've created a look and feel I like using some custom get_post_meta fields for ...
2
votes
2answers
2k views

Matching Serialized Arrays with meta_query

I've asked a related question previously, but I think I've finally worked out the crux of my issue. I'm using Advanced Custom Fields and have a number of custom fields attached to my post type. I'm ...
0
votes
1answer
548 views

change attachment custom field onChange event

The form is in post creating window. Ajax is posting values, but the values doenst renews. Where can be problem ? Ajax <script> function dynamic_Select(field, aid, value) { console.log(...
0
votes
2answers
640 views

Woocommerce custom fields

I'm using woocommerce plugin in my wordpress web site. In Admin panel for products I've added few custom fields as shown bellow: On my shop page, I want to print the custom field values, and I use ...
0
votes
2answers
487 views

Custom search SQL Query to add custom field in result

I have to write my own MySQL query since I haven't found a good way to do it within wordpress functionality. I want the search query to search trough post_title / post_content & meta_key ...
1
vote
1answer
767 views

get_post_meta unserialize issue - retuns boolean(false)

I´m using a simple custom plugin that parses and saves external XML data as a serialized array in a custom field. This works fine, however, when I update the post, instead of the array I only see a ...
0
votes
1answer
488 views

How to enable revisions for post meta data?

Normally wordpress keeps revision of wp_post table. But for generating a report I need some custom fields to be tracked while any update happens. As custom fields are saved in wp_postmeta table I need ...
0
votes
1answer
1k views

How to delete file uploaded by Plupload

I follow the steps from here to integrate the plupload in metabox. Everything is working fine. But I did find one disadvantage of this guide. When I click the 'Remove' link from the uploaded images, ...
0
votes
2answers
507 views

Guest Author - How to display posts on /author/ archive page

I have used the Advanced Custom Fields plugin to create all the data elements for a company leadership directory page and management bio pages. On the site blog, management will not be posting ...
2
votes
0answers
17 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?
2
votes
1answer
1k views

How to filter a dd/mm/yyyy date from a custom field in a query

I'm trying to build a query in order to sort some posts by a date custom field, where the dates are formatted dd/mm/yyyy. It works by querying the database directly with get_results like in this ...
3
votes
2answers
90 views

How to get custom post meta using REST API

I am trying to create a REST APIs for my wordpress website which is used for facility listing using wordpress job manager plugin. I have registered my custom post , taxonomies in \plugins\rest-api\...
0
votes
0answers
18 views

Custom fields for media library images

I want to create custom fields for wordpress admin media images. Can you suggest some plugin or easy way to do that? than i want to get that fields at image.php
0
votes
1answer
27 views

After ajax image is outside the `<a>` tag

I am loading some content via AJAX, and basically I have this line: $storage .= '<a href='.get_permalink($id).'><img src="'.$image['url'].'" /></a>'; Which gets rendered as: <...
0
votes
0answers
14 views

Table showing data from posts

I have set up a custom post type, with several custom fields to store individual pieces of data. Is there a way to display the data from the posts in a table? Ideally I'd be able to implement search ...
2
votes
1answer
76 views

How can i make WP_Query return post image and categories?

I have a sidebar widget that will display related posts based on a custom meta field. The query works, but its very wasteful. All i need is the post title, featured image and the categories of the ...
0
votes
0answers
10 views

How to target page editor fields when using an import plugin?

I currently have a need to create many pages that only differ by a small amount, so I figured I search for a plugin that can allow me to import multiple pages that I'll create in Excel and save as a ...
7
votes
5answers
7k views

Is there a way to set default custom fields when creating a post?

When I'm creating a new post, just after clicking "Add New", when the post editor shows, instead of having to use the dropdown and choose a custom field to use, I'd like to have some default custom ...
0
votes
1answer
16 views

Add commentmeta custom field to every published comment with SQL

I am trying to add custom commentmeta "likes" with 0 as default value to every posted comment. I have this query but I dont see any error there, but still it doesnt work. Can anyone help me to solve ...
0
votes
0answers
18 views

Query Posts by post_meta using WP_Query (data saved as array with keys)

I am working on some project where i need to create class (like karate etc...). My question is, how can i work with WP_Query to Query all the posts by post_meta where the key "day" is "1" for example....
0
votes
0answers
12 views

how to display a sidebar widget based on a dynamic custom field?

I used to manually assign a sidebar to a post based on a custom field using the following code in the sidebar global $wp_query; $postid = $wp_query->post->ID; $sidebar = get_post_meta($postid, "...
0
votes
1answer
761 views

Filter by Custom Taxonomy AND Custom Field

I'd like to give my users the possibility to filter the posts by Taxonomy Terms AND Custom Field values. Like so: [tax]Country:[terms] [tax]Company:[terms] [field]Price:[values] Filtering by ...
3
votes
3answers
7k views

Get value in custom field with taxonomy [closed]

I have custom field my_cf for Taxonomy/Term. How can I get and output value with custom field for taxonomy/term? I've tried using: $variable = get_field('my_cf', 'basic'); echo $variable; ...
0
votes
0answers
19 views

Content by location - custom meta OR Multisite

I'm looking at organising content by location for a client, initially just two cites, but moving on to three in the future. The client has a LOT of content for one location already. Is it better to ...
1
vote
1answer
37 views

delete custom post based on custom field date

RESOLVED ## updated code below. I had created custom post type called 'esitykset' and I wanted to delete them if they are older that the date in 'show_date' custom field of the post. So I tried the ...
3
votes
4answers
985 views

How I check if the same post slug has not been used before publishing?

For an indie rock agenda I created event posts. With the help of javascript, the custom fields values (bands, places and date info picked in select boxes) are copied as the post title when publishing ...