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

learn more… | top users | synonyms (2)

1
vote
3answers
4k views

meta query not showing any results?

I'm trying to show result for a custom field that is not empty on a custom post type but getting no results? <?php if (have_posts()) : ...
0
votes
2answers
766 views

Filter or order based on custom field

I have added a custom field to some posts called 'frontpagerank' The plan is to order the posts by this value but first I just want to filter out any that don't use a front page rank. I have achieved ...
1
vote
2answers
3k views

query_posts and only show results if a custom field is not empty

How do I query_posts and only show results if a custom field is not empty or has a value. I want to put in a url in a custom field and only show these pages if there is a url? current code but I ...
0
votes
1answer
229 views

Use update_post_meta to older posts

It is possible to use the function update_post_meta on older post? I have + 1000 posts and I need to update posts using update_post_meta but I'm affraid to do it one by one. Is there a simple way ...
1
vote
2answers
790 views

Automatic Refresh all posts at once

I created a function to save custom fields on publish a post. Something like this. function create_fields() { global $post; $casa_id = $post->ID; ...
1
vote
1answer
668 views

Author custom fields post meta, the code?

If I wanted to get a custom field of the current user I would use something like this. <?php echo get_user_meta($user_info->ID,'address_line_2',true);?> This time however I want the author so ...
0
votes
1answer
134 views

Add custom fields from different posts

I am trying to add up custom fields from different posts. The array I created is not working. Here is the code. <?php $totalpricearray = ...
2
votes
1answer
299 views

template_redirect for single posts w/ custom fields

Is there any way I can use is_single() inside of my plugin's functions.php file? Currently, this is what my code looks like: if(is_single()) : function my_template() { include(PLUGINDIR . ...
1
vote
2answers
855 views

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?
0
votes
1answer
351 views

How to make a pulldown menu display custom meta terms in a theme?

I have a pulldown menu in a custom write box that classification numbers. How can I populate a select box on the front end that will: a) be populated with all the possible values defined in the ...
3
votes
3answers
3k views

Add new “Insert Into Post” button with another function

Problem: Add a hook that automatically adds a short tag to video attachments when inserted from the Media Library (video) tab: Update: This works under the 'Media Library' tab — and doesn't break ...
1
vote
1answer
569 views

How do I modify the “Insert Media” lightbox in the admin to only show media items from a category?

I am attempting to resolve a problem I continue to have with the media library. Essentially, what I am looking to do is "automatically" assign media which is uploaded from a custom post type "edit ...
0
votes
3answers
127 views

Am I overusing custom fields (for adding nearly 5 images and their titles)?

I never used custom fields so I got a bit exited. I'm not sure if I'm overusing them: (I'm using them to display the title of images and images themselves. (big and small ones). I used to do it ...
0
votes
2answers
276 views

How would an if statement surrounding a custom field with two variables (holding values) look like?

This is from the codex: <?php if ( get_post_meta($post->ID, 'thumb', true) ) : ?> <a href="<?php the_permalink() ?>" rel="bookmark"> <img class="thumb" ...
0
votes
2answers
790 views

Custom Field is getting the value of another page/post instead of the current one?

I'm using this same come in two files: single.php and home.php: (Outside of the loop). (There is a #mainbar div in both single posts and home page but the image should be different) <?php // ...
1
vote
2answers
71 views

Is it better practice to use 'This Name Format' or 'this-name-format' for custom fields?

I've seen in various tutorials where people white the custom field Name in this fashion: intro-image. I thought I would make more sense to use (user friendly names instead of something that looks like ...
0
votes
1answer
387 views

Custom Page Template [closed]

Could somebody help me make a custom page template? I'd like to have a basic page (with sidebars, header and footers) and a table for data. I'd like the data to be taken from custom fields. ...
1
vote
1answer
353 views

Making custom field's 'Name' available in the dropdown list by default in a theme?

My single.php file has the following code: <?php // Set and display custom field $intro_image = get_post_meta($post->ID, 'Intro Image', true); ?> <div class="block-1"> ...
4
votes
3answers
8k views

Filter by one custom field, order by another?

I have a custom post type "Listing" and I want to get all Listings that have a custom field gateway_value != 'Yes', and order the results by another custom field, location_level1_value. I can get the ...
0
votes
1answer
167 views

Display additional user fields

A theme is in development that echo's fields from the users account on their themed account page. This is the standard format. <?php echo $current_user->user_lastname;?> Thats all well ...
11
votes
5answers
9k views

getting all values for a custom field key (cross-post)

I know how to get a custom field value for a specific post. get_post_meta($post_id, $key, $single); What I need is to get all the values associated with a specific custom post key, across all ...
5
votes
1answer
16k views

How to enable custom fields for pages (if not a bad practice)?

My main page has a intro image beside the main content. I would like to add that image using custom fields. I've noticed that pages don't have. I would like to enable them. Is it a bad practice?
0
votes
1answer
186 views

Custom Meta Data is not being saved

I have created a custom meta box using following link in wordpress 3.0: http://farinspace.com/how-to-create-custom-wordpress-meta-box/ I am using same code and custom meta data is not being saved. I ...
0
votes
3answers
246 views

Solve product properties with custom taxonomies?

I need to add about 50 properties to a product, such as heigh, width, location etc. I created custom taxonomies for every property and ran into serious problems. First of all, the UI is a mess! Every ...
1
vote
1answer
2k views

Saving custom data for each user

I allow users to save some notes on my wordpress site. They can only do this after they login to the site. Now I want to save their notes in a database table and associate them with the user's id ...
1
vote
2answers
903 views

adding custom fields to next and previous post link

Im trying to make my next and previous post buttons display my custom field but for some reason it doesnt display the custom field its just blank. Heres my code. <div id="next-prev-links"> ...
2
votes
2answers
993 views

Correct Approach for Validating Custom Field Input

I have a custom post type with several custom fields. I am looking to do some validation on these fields because they will be used downstream by other services. So, it is important that it can't be ...
2
votes
2answers
1k views

Retrieving values of custom fields in Quick Edit mode

I've been trying to add a field to Quick Edit. Somehow it works: it is displayed and if you enter a value in the input field, the value is saved into a custom field. However, can't seem to find a way ...
4
votes
1answer
1k views

How to order adjacent posts (prev / next) by custom field value?

I am using the More Fields and More Types plugins to create a custom post type called product. This custom type is based on the Post type. One of the fields is named lot which is an integer ...
1
vote
1answer
935 views

Use WP 3.1 Internal Linking 'widget' as a meta_box

There is lots of information out there on how to customize meta boxes added with add_meta_box(), such as enabling WYSIWYG editors on textareas and uploading images. What I have yet to find is a way ...
-1
votes
1answer
1k views

WP insert post PHP function dynamically generated Custom Fields

Further to my previous question WP insert post PHP function and Custom Fields We have a working insert post function that can also send over custom fields without yet knowing the ID. Please see the ...
8
votes
4answers
17k views

WP insert post PHP function and Custom Fields

The wordpress function is used for submitting data programatically. Standard fields to submit to incude the content, excerpt, title, date and many more. What there is no documentation for is how to ...
0
votes
1answer
243 views

how to store values in database at hierarchical view

In my project i need to create restaurant menu card,i want to insert values given below -menus(like dinner,lunch,breakfast) . -menu_group(like soup,juice) . . -menu_item ...
2
votes
2answers
1k views

How to change what the post creation page looks like?

Is there a way (plugin, or something else) to set it where there is a drop down on the "New Post" page that allows you to choose a post type and the fields change allowing you to filter what content ...
0
votes
1answer
65 views

Non-Closing PHP Query in WordPress Loop

I have the following query in WordPress to call custom post meta, everything is working fine, with one exception, whichever query is second is echoing nothing. Sorry for the WordPress post, but for ...
0
votes
3answers
769 views

Custom post type missing custom fields

The theme I purchased came without custom fields in the post/product editor. It uses a custom post type in its own admin php file. I've managed to add custom fields by pulling the following code out ...
0
votes
3answers
97 views

Amazon.com intergration with WordPress?

Wanted to know if there was any documentation or plugins that allowed a site to pull prices and other information from Amazon.com on DVD's and other products. I'm creating a plugin that stores ...
0
votes
2answers
325 views

How to get events using multiple custom meta fields?

I need to grab a list of current events. The events have a start and end date so I need to be able to select a range as opposed to just getting any list of events that have an end date that is after ...
1
vote
1answer
646 views

How do I associate a custom post type with another through a taxonomy or storing an ID in a custom field?

I'm working this problem discussed here: Custom Comment Types, but I need more clues to map out the process. I want to create custom post types and associations between Questions & Answers, and ...
1
vote
1answer
1k views

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 ...
1
vote
1answer
3k views

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 ...
0
votes
2answers
885 views

wp custom field date format compare

How do I possible to work with this code to work with date format Y-n-j Value start_date = 2011-1-20 end_date = 2011-1-30 Here are the original function came from this Query between two meta ...
0
votes
1answer
135 views

Only admin should be able to add a particular custom field

I have a multi author blog, I want to restrict authors from adding custom fields with a particular key. For example I dont want authors to edit or add the custom field "rating"
5
votes
3answers
6k views

Custom search: by post data and post metadata?

I'm struggling with a WordPress search function. Maybe it will just help if someone can explain to me how the built in WordPress function works. But here's what I want: Two search fields, by name ...
1
vote
1answer
1k views

Create custom fields as image uploads [duplicate]

How can I define a custom field that works as an image upload? Should be fairly basic but I can't seem to find the solution. Let's say you create the post type 'book' and want to create 3 fields: ...
0
votes
2answers
328 views

Displaying page image in the footer automatically

I've got the following problem: each page of the site has its own image which needs to be placed within the footer div for correct, static placement. However each image is different so I can't just ...
2
votes
4answers
1k views

Custom field values repeating

I'm at a loss. I've got a custom meta box with the 'multicheck' code that Jan created. It's working great. My issue now is getting the data to return properly. Scenario: there are 5 possible values, ...
4
votes
1answer
4k views

How to filter custom posts by tags and custom fields?

I'm planning a site for a client who wants users to be able to filter upcoming events by the following criteria: Type i.e. Comedy, Theatre, Music etc. Date Daily or Weekend Duration Daily or Half ...
3
votes
3answers
4k views

Custom Post Types: How-to get rid of editor (-meta box)

I'm questioning how i can get rid of the post-editor (visual + html). I tried to not register post type support, and it still appears (de-registering works fine with every other default meta box on ...
0
votes
2answers
3k views

How to add/save Custom Field in user settings/profile “Checkbox list”

i have been working on a custom system for my site where users can have a seperate account, setting and profile page to make my site a bit more interactive and community type. with some other ...