Articles of custom field

Dynamically add / duplicate custom meta in custom post types

I am using Custom post types in one of my themes I have one custom post type called “accommodation” with meta boxes to add details such as type of rooms (single, twin, double…); each room has a price according to different season (high season, low season, peak season – each could be ). However the […]

Count how many posts have a custom field set

I’ve added some code to my templates which automatically adds custom fields to cache some data that each post pulls in. Is there a way that I can track how many posts have had this custom field set?

How to insert content from another Custom Post type into Post?

Say I have a custom post type called “Performers”. This gets populated with different bands/performers. These posts have a featured image as well as custom fields (mp3 file, facebook link, myspace link, etc). I have another custom post type called “Events”. When I create a new Event post, I would like the option to have […]

Where did the Add New Custom Field go?

In the latest version of WP it’s gone. Why?

how to add custom fields in page

I am still new to WordPress and I want to insert a featured content gallery into a WordPress page. I tried to do it myself, but it wanted me to use custom fields. Where can I add custom fields, is there any coding required? or do I just enter the value into custom fields text […]

using multiple meta_key and meta_value in query_posts

how can i use multiple meta_key and meta_value in query_posts? For example, I want to find multiple content with two different meta_key and meta_value. How do I do this? i using this code but not effective: query_posts(‘meta_key=test2&meta_value=hello&meta_key=test2&meta_value=bye’); please help me…

how can i use custom field in query post

I want to get all featured items using query post. featured is meta_key using custom field plugin. I tried bellow,but it failed $featured_item = new WP_Query(‘posts_per_page=-1&cat=3&meta_key=>Featured List&meta_value=>Yes’); my wp version is 3.1.3 EDIT: $arg2 = array( ‘posts_per_page’=>’5’, ‘cat’=>’3’, ‘orderby’=>’rand’, ‘meta_query’=> array( ‘key’=>’Featured List’, ‘value’=>’Yes’, ‘compare’=>’LIKE’ ) ); $featured_random_item = new WP_Query($arg2); This query also failed. […]

Add url from Custom Field as 'Featured Image'. Code not working

I’m trying to migrate a site to WP. We have a whole bunch of pictures, and I have done some research and figured — I think — my best bet is a CSV import of the data, storing the relative URL of the image as a custom field. So, I found this –which looks ideal […]

anything like add_meta_box for categories?

I want to add few custom fields to categories. So I am looking for something like add_meta_box but for categories. Is there any WP function like that for categories?

Why do I lose the content of meta boxes when I leave the page?

So I’ve been coding a theme and I’m working on a custom post type. When I edit a custom post and save the changes (click Update) everything is ok. But – I noticed that when I leave the Edit page open for a while and come back to it a few minutes later and try […]