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

learn more… | top users | synonyms (2)

2
votes
4answers
2k 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
2answers
114 views

Setting a custom $query->query_vars['meta_key'] breaks the WordPress menu

First of all, my problem is very similar to this one: http://stackoverflow.com/questions/10629245/wordpress-menu-disappears-when-query-query-varsmeta-key-is-set However, the answer accepted for this ...
0
votes
1answer
27 views

do_shortcode close

I am using the jscrollpane plugin on WordPress along with the advanced custom fields plugin. The jscrollpane plugin uses the following shortcodes: [vr_jsp] [/vr_jsp] I have two different custom ...
-1
votes
1answer
29 views

Custom fields doesnt work well with any postTAB plugin

Here is my problem: I tried to implement custom fields (text) within a post tab. I tried many post tab plugins and the imlementation to template was succesfull... Unfortunately, the content of the ...
1
vote
1answer
25 views

Linking Custom Fields to Database Records

Hey there im fairly new to wordpress and php, but have a strong programming/database background. I recently learned about custom fields and am wondering if it is at all possible to do the following ...
0
votes
1answer
43 views

Filter and display a specific custom field value [closed]

I am developing a travel website for an agency. I'm trying to to make the user able to select an option like "Select your departure" and filter the loop with all the departures available for the ...
6
votes
3answers
334 views

Adding custom input for data attribute in insert media modal

I'm trying to add a text input to the "Insert Media" modal in the hopes of being able to add an html5 data- attribute to the images' parent anchor. <a class="fancybox" href="..." ...
0
votes
1answer
34 views

Hide a div when a custom field is empty

I am having trouble hiding a div when the input of a custom field is empty. This is the code I am using but can not seem to get it to work. The field that displays the content is _cmb_fe_wysiwyg ...
0
votes
1answer
26 views

one get_posts to return a number of custom posts for each meta value

I have setup a custom post 'product' with a custom field cf_type. I wish to have one get_posts that will return 20 total products, 10 products with cf_type: fog and 10 with cf_type: gof. Is that ...
0
votes
1answer
36 views

WP_query returns error when used for custom widget

I was working on creating my first plugin/widget that should display a really simple loop containing only a custom field (image) I've been testing the loop without any problems in my theme but when I ...
0
votes
0answers
17 views

Custom field with subdomain

I am currently having a problem related to the display of custom field article is "language" Specifically as follows: I have a blog with multiple applications for mobile phones, as this blog ...
0
votes
1answer
46 views

Show Custom Post Type taxonomy term that matches custom field

Not sure how well I can explain this but I will try. I have two Custom Post Types. One is "Locations" and one is "Members." I need to show only the members that belong to the location. "Locations" has ...
1
vote
1answer
20 views

WordPress Custom Field Should be Unique. Is it possible?

I have a custom field called "website_url". It should be unique. Ex: If a author set "http://wordpress.stackexchange.com/questions/ask" as the custom field value as a post, ...
0
votes
0answers
12 views

Only display custom fields that are associated with template

I am in a predicament where I have entirely too many custom fields displaying in my admin. Ideally I would like to filter through all custom fields created for my site and only display the ones ...
0
votes
2answers
45 views

Can we create a custom post template for a specific page template

I am working in wordpress for the first time and the client had a requirement that we create a template which will be used for multiple products as shown below The question I do have is it possible ...
0
votes
1answer
474 views

Calling custom profile fields?

I've hidden and created various profile fields using the following code: function my_user_contactmethods($user_contactmethods) { // You can get rid of ones you don't want ...
0
votes
1answer
21 views

How to query the custom fields by language?

For each post, there is a custom field name "Function", the key/value pair is like this: Key : Functions Value : <!--en-->Nourishing Yin and invigorating the vital essence of ...
1
vote
3answers
976 views

Displaying Custom Fields on Post with Genesis Child Theme

I have tried everything to get Custom Fields to display on my posts using a Child Theme of the Genesis theme framework. I have tried to follow every tutorial I could find relating to it but still I ...
0
votes
0answers
37 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'], ...
1
vote
2answers
3k views

Get custom field values into the sidebar/widget?

I haven't seen this done, but I want to return the custom field values outside of the loop in the sidebar.
0
votes
1answer
3k 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, ...
1
vote
1answer
346 views

Facebook social publisher and custom post type fields [closed]

I have a problem with how Facebook plugin shows my WordPress-based posts on my timeline. What basically happens is that the post image isn't shown. Now, the post image I want to show is a custom ...
0
votes
1answer
18 views

pre_get_posts causes Custom Posts appear under 'Pages' menu

In order to enable pagination on for custom post archive I've added pre_get_posts function. But, funnily it caused my custom posts be duplicated under 'Pages' menu. Here is the code that causes the ...
0
votes
0answers
34 views

display some fields in custom post backend

I am using the following code for the custom post.But i want three fields i.e Location,Persons ,Client to permanently appear in the backend of the custom post rather than having to create and select ...
0
votes
2answers
356 views

“Matching” or “Linking” Two WordPress Pages: Custom Fields?

I'm helping with a custom multi language site. We have one page in English, then an equivalent page in French. I've got a "SWITCH LANGUAGE" link in the main container (next to the breadcrumbs) that ...
2
votes
1answer
31 views

Custom field when adding new site to multisite networked WordPress

I have a multisite setup in WordPress. Is there a way for me to implement a custom field when I create a new site in Admin > Sites > Add New. My current options are Site Address, Site Title, Admin ...
0
votes
1answer
1k views

2 orderby in wp_query with 2 custom fields

I'm triyng to display hotels (taxonomy which i have created) by two 'orderby' with wp_query but i'm not success. Results looks likes: Hotel 1 : 2 persons 5 stars Hotel 2 : 2 ...
0
votes
1answer
28 views

Create a list of posts with topic headdings

I would like to use a custom field "topic" to order Wordpress posts. This seems quite doable using 'orderby' => 'meta_value', 'meta_key' => 'topic' But I would also like to have a title of ...
0
votes
1answer
37 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 ...
0
votes
2answers
272 views

How to add an extra field in a post and show it on the template

I'm extremely new to WP. I want to add an extra field to the Post interface and show the content on a template. I don't want to show the content of the Post, but just the content in the extra field. ...
0
votes
0answers
184 views

get url image of custom field with custom size - get_post_meta, wp_get_attachment_image_src

I use a custom WP_Query to load image and other information from custom post type event to supersized.js script. This query get all custom post type event with custom field wpcf-img-event not empty ...
0
votes
3answers
41 views

Deleted pages showing up when querying for child pages

I'm using the following code to display the featured image, post_title and custom field data from relevant child pages. <? $child_pages = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE ...
0
votes
1answer
84 views

How to store the value of a custom field dropdown select for post referencing?

I'm trying to reference posts to each other. Editors should have a custom field select list of certain post's titles to link the current post with other posts. I got quite far, I think. The select ...
0
votes
1answer
26 views

Adding custom fields to images

I want to show sources under my every images. So basicly I want to add a simple custom field. I added this code to my function.php add_filter('attachment_fields_to_edit', 'edit_media_custom_field', ...
0
votes
1answer
142 views

Group WP_Query by meta_key date

I have a wp_query which lists posts from a custom post type, sorted by a custom field 'time'. I'd like to group this list by another custom field 'date', so that every post that has the same custom ...
0
votes
0answers
41 views

How to save dynamically generated value in post type?

I'm trying to use the count of the amount of people that register a post id to a table in the DB. I want to save this COUNT value to the post_meta so when I display the list of posts it can also show ...
1
vote
1answer
222 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 ...
1
vote
1answer
88 views

Create Pop-Up Box with Custom Field Content Inside the Loop

I tried this using ThickBox first, then tried using some code I had that worked on another website... Total failure. The Goal: I have a custom post type (product) with a ton of custom fields. I also ...
1
vote
1answer
90 views

How to create a Custom Meta Box with Name/Value Admin User Input Fields?

I have researched many tutorials on how to create/add Custom Meta Boxes using the add_meta_box() Wordpress function. I can not find any example where the finished Meta Box has the option for an Admin ...
1
vote
1answer
425 views

Add More Fields to Users Pages (Admin Panel)

So I'm trying to create some custom fields for users. I need to give users access to a 30 day trial of some software and I want to keep track of that in the users page of administration panel. If the ...
0
votes
2answers
67 views

How to get multiple checkboxes in one meta field

I can manage to show one checkbox using woocommerce products custom fields However, I need to show multiple values from multiple checkboxes in my admin area. I have the following code: <input ...
1
vote
0answers
37 views

conditional logic for front-end custom field edits

I'm just starting to learn php/js and would like some recommendations on the best way to setup my logic: Goal- Display the value in a custom metafield in the custom post type. If the user is the ...
3
votes
2answers
763 views

How can I save repeatable fields with one value inside an array?

Introduce I am currently working on a slider plugin to learn a lot of PHP and WordPress. I have create some repeatable field with javascript. Some functional details: When the user is clicking on ...
0
votes
0answers
20 views

Custom post with custom category and custom meta box query and order by custom_value

Im building a Library CPT= Libro Custom Taxonomy= categoria_libro (as category) Custom meta box which has: autor editorial ciudad año As it says in the title, I need to query a custom post ...
1
vote
1answer
1k views

Order get_terms() By Custom Field

I want to order my categories like I order my pages. I've added an extra field called Order to my taxonomy, but how do I order my terms by this value? Adding and Saving my Order Value: /** Add New ...
0
votes
1answer
45 views

Is it possible in WordPress

I am trying to create a ranking based on user donation, my problem is I am not sure if wordpress user meta support append For each Project a user can donate money via paypal In WordPress User Meta I ...
0
votes
1answer
15 views

Change path to child of page when uploading image via custom field

Is it possible to change the path of an image when it is uploaded via a custom field so that instead of appearing as www.mysite.com/wp-content/uploads/2014/05/file.pdf it will appear as ...
0
votes
0answers
8 views

Default Custom Field User Data

I want to create a user meta that would either add or update In the user meta there are two custom field 'projects' and 'amount' so if user donated $1 to project A the user meta will create a row, ...
-2
votes
1answer
502 views

How to include custom field in shortcode (do_shortcode) in theme file

To cut out a few steps and make it easier for authors, I have included a custom field for authors to enter details (may include HTML). I want to add the custom field to a shortcode in the theme. ...
4
votes
3answers
11k views

How to Add Custom Fields to a Custom Post Type?

Ok, so I have registered a few custom post types and a few taxonomies. Now, for the life of me, I cannot figure out the code I need to add a Custom Field to my Custom Post Type. I need a drop down ...