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

learn more… | top users | synonyms (2)

1
vote
1answer
38 views

Using PHP to read Wordpress Posts

I'm a beginner in PHP and Wordpress and I would appreciate help on project I'm working on. Currently I am using the below code to query a specific post and then echo it's expiration date (expiration ...
0
votes
1answer
38 views

Post counter wrongly increments

What I am trying to do is to create a simple function to display the post's view (hit) count. So each time the page is loaded, a variable will automatically increment by 1, and persisted via the ...
0
votes
0answers
25 views

How to get custom taxonomy ID by custom field value

I have created custom post type products and custom taxonomy cats for this post type. Then I have added a custom field for taxonomy cats named cat_pp_id. Now I need to get taxonomy ID using value of ...
0
votes
1answer
29 views

Showing custom field contents without listing description

I'm customizing a directory theme and my custom fields appear only if I put some text at the company's description, otherwise it will show nothing... Any idea how to fix that?? I think the problem ...
0
votes
0answers
16 views

User Specific Taxonomy Terms

Is there any way that I can program user specific taxonomy terms. The way WordPress taxonomies work is such that if a taxonomy, say "Music Genre" is available on the site, and if one user inputs some ...
0
votes
1answer
38 views

add_meta_box Callback not being called

I created my first plugin last week that makes a custom post type. As this worked, I copy pasted the code I already had and modified it to be a different post type. For whatever reason however, the ...
0
votes
1answer
47 views

Price comparison table based on Custom Post Type?

I have created a review site where clients can rate their hosting providers based on various factors, however since the launch, many have asked if it would be possible to create a price comparison ...
0
votes
0answers
16 views

Displaying checkboxes custom field as list

I have a checkboxes custom field, and I figured a way to show it as a list, the problem is, the name of the field shows as an item on the list, instead of for example: Items: Item 1 Item 2 it ...
0
votes
0answers
49 views

Meta Compare (EXISTS) does not work

I want to include the posts that have a certain meta_key and exclude those that does not have that meta_key. NOT EXISTS works but EXISTS fails in the code below. function include_meta_key( $wp_query ...
0
votes
2answers
845 views

Create ul list in Custom Meta Box?

I need to create an ul list in a Custom Meta Box. The content/text area of the post is already taken up with other information. Is it possible to create another text area like WP built in one so I ...
0
votes
1answer
18 views

Related query shows same image in loop

I'm using the code below to query all other posts with same value in custom field FeaturedArtists. Works great except the images. All images are the same as the current post. If I change ...
0
votes
0answers
38 views

Add Custom Field to Custom Post RSS

I have a custom post type called "Podcasts" with a custom field called "podcast." The custom field is generated by the Advanced Custom Field plugin. I am trying to figure out how to hook the feed up ...
5
votes
1answer
159 views

Pass all custom fields through the same filter on post load?

Is there a way to filter all custom fields on a post? Lets assume for very basic simplicity I have: standard fields of: title post body custom fields: author ISBN quote Lets assume on page ...
1
vote
0answers
61 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 ...
0
votes
1answer
30 views

Wordpress taxonomy child image

I've set up a hierarchical taxonomy. Each taxonomy has an image field I'm trying to output the title, image and link of child taxonomy on their parent page. I've managed to output the title and link ...
1
vote
1answer
21 views

Admin Custom Meta Box - Pull Last 5 Posts from Custom Post Type

This is what I'm trying to accomplish, I have a custom post type of "demos", from here I can add custom CSS/HTML/JS to display a demonstration (online preview) of what it is I have designed/coded. ...
2
votes
2answers
62 views

Custom post meta field effect on the performance on the post

I have the posts which have many custom defined meta fields. On posts I am calling them on requirement using get_post_meta. Means for 10 meta fields I am using it 10 times. Am I doing it right? ...
0
votes
2answers
37 views

Custom Post Type Fields

I am very interested in creating a coupon plugin for Wordpress, where many of the existing options do not meet my current needs. I have build the core plugin and it is working as expected now so I ...
0
votes
1answer
55 views

Call the latest posts from a custom field group to be displayed on front-page

i have this custom Metabox field group from https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types#group containing 3 fields and displayed on the Products page ...
0
votes
0answers
41 views

Post type archive pages with custom query

Apologies if this is something trivial, but I can't seem to get it right and I can't quite find the correct way to tackle this from previous questions. I am building my own theme. I have the normal ...
0
votes
0answers
27 views

Grouping search results in search.php based off on categories AND custom field names

Wondering if it's possible to output search results based on custom field names and categories via search.php file. I tried this: (with two categories) But didn't work for some reason? <?php ...
0
votes
0answers
67 views

Create custom fields/meta data gender+country - radiobuttons and dropdown on register screen for these fields

On register I want the user to select gender (radio buttons) and a country (dropdown from list of countries) as well as an agreement checkbox. I'd also like all of these to be editable on the user ...
0
votes
2answers
82 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
0answers
39 views

Store input from user into DB

I'm building a simple web application using Wordpress that takes tons of input from the user (text as well as images and video) about themselves and shows that data (profile) either publicly or ...
0
votes
0answers
33 views

WordPress Custom File upload meta box saving 0 bytes as File size

I am trying to save custom images with the custom post type , so i added a custom meta box for file upload . it seems it is working fine but when i upload any file it save the file size is 0 Bytes . I ...
0
votes
1answer
27 views

How do I display posts with specific value in a custom field into my loop?

I'm trying to display posts that contains a specific value from my custom field. For example, I created a custom field that asks for the year, let's say I would like to display only posts with the ...
0
votes
1answer
30 views

post_per_page ignored in WP_Query

I have a custom post type named 'album' and I added two custom fields 'release_date' and 'release_date_us' with the ACF plugin. I'm trying to display the latest albums based in a widget area. The ...
4
votes
1answer
864 views

Show links to archive pages based on custom field values

I have a recruitment website on which I want to display a list of Job Location links. The job location has already been entered into a custom field for each post so I just want to display a list of ...
1
vote
1answer
34 views

How can I dynamically add a post to a custom post type which uses a custom field?

I have a custom post type called "patients". I was using only the post title, but now I need to make a relationship with users. I made this by creating a custom post field (created by ACF), a ...
0
votes
0answers
197 views

How to add custom_fields value in JSON API using create_post

I want to add/update custom fields values using JSON API,anyone explain how we can specified custom_fields values in url for add or update.
0
votes
1answer
118 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 ...
3
votes
1answer
98 views

Order by meta_value_num DESC and meta_value ASC on WP 4.0

I have created a custom post type that I want to order by custom-field-1, which is boolean so its value is either 1 or 0, in DESC order (1 to 0) custom-field-2, which contains text and is supposed ...
0
votes
2answers
22 views

When creating a metabox do you have to create DB fields for the data?

I'm just getting to grips with metaboxes for the first time and after reading up on them one of the main question i have is do you need to specify fields in the DB to store the data got input. i.e. if ...
0
votes
1answer
31 views

Show custom field if it exists, and show different elements if it doesn't

Basicly what I'm trying to do (with very basic knowledge of PHP): If Custom Field $randomname exists for that particular post, show the content of that custom field. If Custom Field $randomname ...
0
votes
1answer
58 views

CPT Repeatable Fields + Undefined Index

I'm using this code here for repeating fields in a CPT (yes, I know of ACF and a few others), and have tried to add a third field. The field is currently displaying in the meta box, and is output on ...
1
vote
0answers
84 views

Undefined index error when saving content on metabox

I am trying to debug 'undefined index' errors on the WP backend when debug is set to TRUE. The offending lines are: if ( !wp_verify_nonce( $_POST['pdwt_meta_noncename'], plugin_basename(__FILE__) )) ...
0
votes
0answers
30 views

Why is my blog theme not showing page and post content, or their custom field values?

I have created a proprietary blog theme, with the following: 1 custom post type 1 custom taxonomy Taxonomy X has 2 terms. Each term has 4 and 7 posts respectively. Each post has 5 custom_fields. All ...
6
votes
1answer
16k views

WP_Query - Order results by meta value

I've checked around and haven't seen an answer which works as of yet. I have a WP_Query with the following arguements: $args = array( 'post_status' => 'publish', 'post_type' => ...
0
votes
0answers
29 views

Using custom fields globally?

I'm trying to use the value of one custom field on multiple pages and posts. I'm a newbie to PHP and custom fields so what I'm trying to accomplish could possible be done using a different method. I ...
0
votes
0answers
18 views

Custom Field for Individual Pages in Multi-Page Post

I have articles divided into multiple pages using <!--nextpage-->. I need a custom field say mycf holding different value for each individual page of the article. Also, I need a way to update ...
0
votes
0answers
20 views

Select value don't stay selected after save

I did a multiple select item that takes his options from another CPT, it works but after the saving the selected items don't stay selected. this is my code for the meta box global $post; echo ...
-3
votes
1answer
19 views

Tons of Custom Fields [closed]

I recently worked on a website (wedding venues) that required tons of custom fields, more than 80 I believe and heavy customization. Suddenly wordpress seemed a bad choice of platform for this ...
0
votes
1answer
32 views

Comparing 2 Decimal Numbers from custom fields and displaying posts

This is really confusing me. Hopefully you can help me. What i want to do, is search for a number and display anything that is either minus 1 or plus one of the search result. The numbers that it will ...
0
votes
1answer
46 views

How to save values of a custom input field on the Network > Site Info screen

I'm struggle with implementing a custom input field on the screen of a Site Info in a Network. I've managed to create a field with help of this post but i have problems with saving the value. When i ...
0
votes
2answers
18 views

Filtered by a custom field, ordered by another

I am trying to loop custom post-types, filtered by a custom field artist-status => invited and ordered by another custom field last-name alphabetically. Here is what I managed to write, and it ...
0
votes
1answer
160 views

Display custom field meta outside loop, site wide

I've created a custom field ("breaking") with the goal that whenever one post has this field present, it will display the value in the header throughout the site (that is, all posts, pages, archives, ...
0
votes
0answers
18 views

Output terms based on custom fields

This question is rather specific. In my custom posttype "sak", I have a taxonomy called "vvpl". This taxonomy has a custom field called "revision" because a term have copies based on how many ...
3
votes
3answers
2k views

querying with custom meta field with meta_query

How do we get posts where the meta key does not exist in a post. I have created a meta_key video. and i want to be able to get some posts with WP_Query where custom field video does not exist or is ...
0
votes
1answer
61 views

Enable a short code in the custom meta field

I was wondering if there is a filter that allows me to enable short codes to work inside the custom meta fields in my posts. I know the following code enables it in widgets: ...
0
votes
2answers
36 views

Add custom fields to existing posts (admin pages)

I'm able to add a custom field for new posts (in the admin pages), using the action hook wp_insert_post. But I would like to add the custom field for old posts, when I am editing the post (in the ...