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

learn more… | top users | synonyms (2)

0
votes
2answers
205 views

Custom Query Fields - Altering Meta Value

I'm giving Custom Query Fields a shot for filtering/sorting posts on the front-end of a site. The instructions seem pretty self-explanatory, but I do have another layer that I'm trying to figure out. ...
1
vote
3answers
4k views

Calling custom fields for pages (not posts)

I'm trying to place a small code in my template header.php file. I want to get a custom field value. I'm trying to call custom fields from current page outside of loop, btw. I have no problem doing ...
2
votes
2answers
740 views

Is it possible to order posts by two meta values?

Hopefully this is a reasonably straightforward question! Is it possible to order posts, on the front-end of my WP install, by two meta values? I have a meta key called genus and another called ...
1
vote
2answers
3k views

Front-end editing with custom fields?

I use the custom field plugin http://www.advancedcustomfields.com Is it possible to create and edit custom posts via the front end? I'd need to be able to see all the custom fields and allow those to ...
0
votes
1answer
472 views

Adding custom field to Lightbox in header only pulls current page data, not Lightbox item data

I'm currently using Advanced Custom Fields to create a custom field has_the_portrait_sold which will be indicated on my Prettyphoto / Lightbox item. However, when I use PHP from the example (it is ...
0
votes
1answer
86 views

Meta boxes not displayed, data isn't being saved

As the title says, I have a problem in functions.php (I assume it's in there) which causes custom fields to not be displayed on the new/edit post page, and when I add the meta box myself and save the ...
2
votes
1answer
613 views

Sort posts based on multiple custom fields

I have a three custom fields Meta Key → YOUR_PREFIX_newcar_body_type Meta Key → YOUR_PREFIX_newcar_transmission_type Meta Key → YOUR_PREFIX_newcar_variant and I have to sort posts ...
2
votes
5answers
4k views

Order posts by custom field and if custom field is empty return remaining posts

I have an archive page ordered by a numeric value in a custom field. This returns the ordered posts correctly, but does not display posts that don't have a custom field. $paged = ...
0
votes
1answer
594 views

Is it possible to use get_post_meta() to control HTML?

I want to hide or show an HTML widget I built depending on whether someone adds custom fields to a page via WP Admin. Is this possible? I'd like to do this in my HTML widget template (tips.php): ...
0
votes
1answer
375 views

Display MP3 as media using an URL from a custom field

I created custom field and placed this inside the loop: <?php echo get_post_meta($post->ID, 'ses', true); ?> But now the link is all text. I would like it to be like my theme does when I ...
2
votes
1answer
475 views

How to put enctype=“multipart/form-data” in categories form?

I had success putting the code below to include enctype (for images) in custom post type forms, but I'm not able to use it in categories form... is this possible? Thanks. add_action( ...
4
votes
3answers
2k views

clients list using wordpress

I am using wordpress for my new website and i have list of clients(name and their logos). I am confused how to make those editable using wordpress? Html as follows... <ul> <li><img ...
1
vote
2answers
193 views

Set front page option using custom fields?

Hello wordpress gurus! I want to be able to set the frontpage via a custom field. So for example, in the new page area in the wordpress admin there is a custom field that displays "Set as frontage", ...
0
votes
1answer
316 views

Saving metabox keys and storing values as array

$key = "key"; $meta_boxes = array( "item-count" => array( "name" => "item-count", "type" => "itemcount", "std" => "", "title" => "How many items?", "description" ...
3
votes
3answers
3k views

SELECT max(meta_value) FROM wp_postmeta WHERE meta_key='price'… stops working when value is over 999

Overview: I am not trying to return a post. I simply want the single highest value for a particular meta_value across all posts... just the value itself. Details: I have added a custom meta_key ...
0
votes
1answer
103 views

Exclude empty fields from custom field calculation (Average)

I'm using some code I found online to calculate the average value across all posts for [a_custom_field]. Does anyone know how to exclude (from calculation) any instances where the custom field = 0 or ...
1
vote
2answers
3k views

How do I use wp_query for WordPress search?

I would like to create a custom search form to search posts based on the values of about 4 custom fields. I tried using wp_query to achieve this but so far my biggest problem is that the I don't get ...
1
vote
2answers
2k views

Add extra fields to Add New Category page

I need to add an extra field to the Add New Category page. Currently it only has fields for Name, Slug, and Description. Essentially, I need to have a second description text box. I use the current ...
1
vote
1answer
596 views

If meta key exists in get posts function otherwise create it

The following code fetches posts with the meta key home telephone numbers. $metas = ''; $args = array( 'numberposts' => 1, 'post_type' => 'electors', 'orderby' => ...
1
vote
2answers
742 views

Duplicate posts being displayed when querying Custom Fields

I have created a small segment within WordPress that records match information for League of Legends. Using up to 30 different custom fields I can store information of 30 champions picked from 3 games ...
0
votes
1answer
926 views

Wordpress User Profile Upload - If page is saved file reset

I have various different extra profile fields which I have set in functions.php however with the upload one if a user uploads an image and saves the form the image is set, however if they go back and ...
1
vote
1answer
129 views

making sense of admin-ajax

So I'm working with ThemeTrust's "reveal" theme, and there is an ajaxed in chunk-of-content that I'm really trying to change (grab custom meta fields (images) + insert into a slideshow). As far as I ...
1
vote
1answer
236 views

Wordpress metaboxes - textfield suggestion automatically populated

[Long story short] Is there any Wordpress plugin/function that would allow the creation/integration of a metabox's textfield that automatically populates a dropdown menu (in the admin area, while in ...
0
votes
1answer
68 views

Custom Fields link to other pages, not search

I am attempting to create a website, which has a similar taxonomy system to IMDB, but instead of Movies, it is referencing Musicians. I have created a custom post type for Artists, with a few custom ...
0
votes
1answer
133 views

Editing custom fields for comments

I need help with why the save function is not working in the edit_comment hook. Here is the code for the 'comment_post' hook: add_action( 'comment_post', 'save_comment_meta_data' ); function ...
0
votes
1answer
56 views

Custom taxonomies to define versions of a product

I have a custom post type that describes components of a product. As the product is developed new components are added. I'd like to define what version of the product the component was added, and then ...
2
votes
1answer
590 views

WP_Query display next custom post from today's date

I have a calendar plugin that uses custom posts types to create events. There are several custom fields that allow me to create various and seemingly unlimited post queries. The one I'm currently ...
0
votes
2answers
5k views

get_post_meta just returns Array

Here's what I am trying to do: I am trying to get one page in wordpress to pull data from custom fields in other pages. So that when a user creates a page and uses a particular custom field (in this ...
0
votes
1answer
78 views

Semi-Private Comments + page comments -> is it possible?

is it possible to do this: User need to register and can only see comments written by himself or by an admin. Admins can see all comments create a profile page that user can see all their comments ...
0
votes
3answers
206 views

Delist entries in the_loop

I am trying to add a delisting feature to my WordPress network. Posts which are delisted would not appear in post lists, but would still be visible if accessed directly. I've written a plugin that ...
0
votes
1answer
281 views

using custom fields on content.php file of my theme

is there any error in following code? when i use following code in content.php file of my theme, then nothing is displayed on blog, it seems there is some error. and when i comment folowing code ...
0
votes
1answer
532 views

get_post_meta returns 0

I am trying to get metadata for a post (of custom post type). I had a look in the database, and the table "wp_postmeta" holds a row with "post_id" = 65, "meta_key" = "name_text" and "meta_value" = ...
0
votes
2answers
1k views

Cannot get <p> tags working from a WPAlchemy metabox with wp_editor()

I'm using WPAlchemy on a project. For a template, I need to use a custom metabox which is working fine with a tinyMCE editor. Code to insert the meta box on the template (this is a piece of code ...
0
votes
1answer
370 views

Alter SQL query to return posts with unique custom field value, no duplicate values

I currently have a list of posts with the custom field "Name," with several posts having the same value for "Name." I would like to retrieve a list of posts that all have unique values for "Name." ...
0
votes
1answer
1k views

Show ACF fields only on certain page in the backend

I have created some custom fields with Advanced Custom Fields and set them to appear in my custom post type named X (post type is equal to X). But I only need them to display on a particular single ...
0
votes
1answer
912 views

Meta query with timestamp using WP_query

I'm having a problem with an events system that I'm developing for a local roller derby leaugue. I have made a custom post type ('event') where a user can add a few different types of events ...
3
votes
1answer
3k views

Custom Meta Boxes: Store two values in one repeatable field

I am trying to create a custom meta box where the user can add fields as needed. I followed this tutorial: http://wp.tutsplus.com/tutorials/reusable-custom-meta-boxes-part-1-intro-and-basic-fields/ I ...
2
votes
1answer
285 views

Create meta boxes that don't show in custom fields

I used the code below to create a metabox for posts. These meta boxes are also seen in the custom fields. I do not want these meta boxes to show in custom fields. Is there any way to not show meta ...
3
votes
3answers
3k views

Add custom option to Standard Page Attributes Meta Box

I'd like to add a simple checkbox option to the exsisting standard Page Attributes Meta Box. Is there an obvious/intended way to do that using the WordPress API, rather than registering a new ...
1
vote
1answer
634 views

Localized Date Format for Custom Field

I'm using a custom field, formatted with "dd-mm-yyyy". I would like to use it with the Date Format defined in the Dashboard settings. It seems alright in English with get_option('date_format'); Or ...
0
votes
1answer
618 views

How to programatically set the post title of a CPT on wp-admin

I've been playing with custom post types & custom fields, using a combination of the types plugin and the advanced custom fields plugin, also having done the same manually. Occasionally I want to ...
3
votes
2answers
252 views

Order Posts by Closest Numeric Values

I'm using custom post types to display properties and have a custom price field assigned to each post. On the property page I want to display a list of four similarly priced properties, two less than ...
1
vote
2answers
419 views

Validate data on attachment_fields_to_save

I'm very glad that there is such a dedicated website for WP. My problem is data validation upon saving attachment fields. I have added many custom fields to attachment/media library dialog, most of ...
0
votes
1answer
160 views

Get post ids sorted by meta_key

I have defined a post_view_count meta_key to store the number of post views. I would like to get an array of post ids sorted by post_view_count value to use in the functions.php file. Thanks.
1
vote
3answers
1k views

Is it bad to use a lot of Custom Meta Fields?

I am curious without doing a ton of benchmarks, how others feel about using several custom meta fields on a blog post? I am talking strictly performance wise, does it slow things down a lot if using ...
3
votes
1answer
881 views

Many to Many Relationship between Two Custom Post Types

How to I create a many-to-many relationship between two custom post types? Give type A and type B, I'd like to be able to show all B's that relate to a given A, and all A's that relate to a given B. ...
1
vote
1answer
691 views

Including Custom Meta with posts_where query

I have been looking around to see how to do this but the solutions i've found don't seem to be working for me. I'm making an AJAX powered search for some wordpress custom post types. I have got ...
0
votes
2answers
101 views

Only show <li> when content added via custom field

I've gone through a few of the other similar topics but any of the solutions won't work for me. Basically I only want to show an if the custom field has had information added into it. Here's my ...
0
votes
2answers
543 views

Nav Menu – Add class based on meta keys

I'm trying to find a way that changes the classes of the different nav menu items, based on the value of a meta key in the page. The menu currently looks like this: <li ...
0
votes
1answer
4k views

Custom “radio button meta box” not saving correctly

I'm having trouble with my "custom meta box/write panel" script that contains radio buttons. (see below)...It currently does not seem to save the selection made after publishing the custom post type, ...