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

learn more… | top users | synonyms (2)

0
votes
1answer
1k views

Get custom field label

I've defined some custom fields using Advanced Custom Fields, and I display these fields as keys and values using get_post_meta, e.g.: <span class="campsite_meta_key">מחיר:</span> ...
0
votes
1answer
82 views

Insert custom fields to a custom post type

I am creating a small blog about my trekking and camping experience. Since different experiences - like campsites, treks and tour operators - have different metadata, I have created a custom post ...
0
votes
1answer
55 views

Single page Wordpress website - custom fields or meta boxes or something else?

Hoping someone can give me a pointer in the right direction. I'm building a website for my friend who's getting married and they've asked to be able to update the site themselves - fair enough. So, ...
0
votes
1answer
147 views

How to sort Custom Fields by a value

i use below code in home page for show a table of custom fields. but i don't know how sort this table by duration value. <table> <?php while(have_posts()): the_post() ; ?> <?php if ...
0
votes
1answer
57 views

Convert many posts from having a specific meta_key to use a post_format

I have 350 posts that were using a plugin-provided option stored in a meta_key ("custom_post_template", to be precise). I want to convert these posts to assign them a specific post_format ...
1
vote
0answers
101 views

Meta Query And/Or

My question is very similar to Meta Query with AND & OR? . This question was answered in 2011 by @Otto. With the exception that my logic is different. I want to query, for example, posts with ...
0
votes
1answer
244 views

Wordpress Media Uploader custom Javascript not working

I encountered a strange problem with my JavaScript (jQuery) when trying to modify the behavior of my Media Uploader in Wordpress 3.5 This was my JQuery: $('.attachment-filters').change(function(){ ...
0
votes
2answers
60 views

I want my post to republish again after adding a custom field

I wanted a code in Wordpress that could allow me to republish the post every time I add a new custom field. For example, if I already have a post and wanted to add an update to it; I want it to appear ...
2
votes
1answer
106 views

How to save multiple metaboxes?

I read a tutorial about metaboxes, most of things are clear but I have a question about multiple metaboxes. My question is about saving, in the tutorial: <?php add_action( 'save_post', ...
0
votes
1answer
329 views

get_post_meta property of non object

I am getting a custom field outside the loop in header.php. I get the custom field just fine but I found that when the custom field is empty, I get an error message Trying to get property of ...
0
votes
1answer
354 views

Display Posts Query with IF function

I'm writing a template to display my custom posts types in a list. But I only want to have the post show if it has a value for one of my custom fields. I'll explain: My custom post type is "Faculty ...
1
vote
1answer
147 views

Create custom field key upon theme activation

Upon theme activation I want to create an 'URL' key for the custom fields. Like in . I know who to run functions when a theme is activated, I don't know how to create this custom field key though. ...
0
votes
1answer
487 views

Archive for custom fields?

Recently I've done a nice taxonomy system on my WordPress website. Created also the taxonomy archive template files, so wherever I'm listing the taxonomies I can click on them and will bring me on a ...
0
votes
1answer
167 views

Custom fields: my custom checkbox area doesn't seem to work

I'm trying to create my own custom fields meta box filled with just checkboxes in pages. I'm basing it off this tutorial here. I was able to get the original tutorial to work, but when I started to ...
0
votes
2answers
489 views

Settings API - save multiple tabs at once

In the attached screenshot you can see the structure of the theme options we are working with. There are 8 tabs and for each tab, we have created custom fields using code similar to what can be seen ...
0
votes
2answers
2k views

Custom fields won't display on my blog page

I created a custom field called 'Page Description' which I use to create a custom title for each static page of my wordpress site. I use the code: <?php echo get_post_meta(get_the_ID(),'Page ...
-1
votes
1answer
111 views

jaredatch metaboxes on video post formats

I'm trying to get a metabox to show up only when the video post formats is selected using jaredatch metaboxes ...
0
votes
1answer
134 views

Custom field Search with Relavanssi

The site I'm working on is a talent website that has actors names, headshots, and resume all created with post_title, featured images, and custom fields. I am using Relavanssi to make my search ...
3
votes
1answer
782 views

How to use multiple query with same meta key

I use these codes to print custom field query. My custom field key is out_wiki <?php if( get_post_meta($post->ID, "out_wiki", true) ): ?> <div class="outlink"> ...
0
votes
1answer
24 views

Collect Data from NEXT item while in loop

I am trying to get the value of a custom field. The trick? I'm in the loop, currently printing out 2 of 5 for this example. I would like to get some info from 3 of 5 (or even 1 of 5) while printing ...
1
vote
3answers
864 views

Change content before writing to database

I've searched around but I can't quite pin down the answer for this. I am attempting to use the content of a custom field as post_data and save it to the database as such when a post is created or ...
1
vote
2answers
2k views

Displaying Meta Box Image

I have some problems displaying info from my custom meta box in my custom post type single. I'm using Reusable Custom Wordpress Meta Boxes by Tammy Hart. I'm able to display the textfields using ...
0
votes
1answer
241 views

Query Problem - Show posts within category 'x' that have a custom field between 'y' and 'z'

I'd like to display all posts within a given price range. For example: When a user inputs 100 and 1000 (in two separate form fields) - my site will display all posts that have a custom field called ...
0
votes
1answer
943 views

Upcoming Event: How do I sort database by custom date field, but ignore past dates?

I am using an events plugin and struggling to get my database query to be perfect. The query is on the event-single.php template. What I need the query to do: Query the "events" custom post type ...
0
votes
1answer
459 views

Order custom fields alphabetically

I've been trying to order the custom fields alphabetically, but I can't get the ordered list I want... this is the code I'm using: <?php $vMarca = get_field('tienda_marcas' , false, ...
1
vote
1answer
62 views

Migrating old posts to new wp, how to extrapolate infos from the post body to custom fields?

I need to migrate some information that are store in the post body (like "price:200$"), extrapolate them somehow and put them into custom fields. how do I do that? The blog is about restaurants and ...
1
vote
2answers
181 views

List upcoming events, ordered by date in a custom field

I want to display a list of events with dates in upcoming order. Ex: 23 March, 2013, 30 March, 2013 Below is the query I'm using to filter out posts from my database: query_posts( ...
0
votes
1answer
169 views

Calling a custom profile field only it it exists

I've used this code to show custom fields if they're filled in a post using Custom Field Suite Plugin <?php if($cfs->get('whatliked')){?> <?php echo $cfs->get('whatliked'); ?> ...
1
vote
2answers
1k views

How to remove slug metabox from custom post type's page?

I just discovered a new meta field on the newly created custom post type page. The meta name is slug, and it's under the wp editor field. What's that, and how can I remove it?
0
votes
1answer
949 views

Retrieving custom field value with get_post?

There's no mention of custom fields values in Get_post's codex page. Is it impossible to use get_post to get a custom field value of some post, and if so, is it necessary to perform a whole loop just ...
3
votes
1answer
2k views

Formatting custom meta box date from YYYY/MM/DD to a more readable alternative

QUESTION This is following a previous question that was graciously answered by Milo earlier here - How to sort CPT by custom meta value (date), and return posts month by month In short, I'm having ...
0
votes
1answer
126 views

Add a class to post_class if more than one post shares same meta_value_num

I would like to be able to add a class such as .samedate to posts that share the same meta_value_num from a custom meta box. So for example: Say two posts share the same custom meta box value for a ...
0
votes
2answers
699 views

How to exclude custom fields from search queries?

I'm building a hotel search engine and I've first created a custom content type "hotel" with Types & Views Toolset. I'm using "Search everything" plugin to query custom fields and custom taxonomy ...
0
votes
1answer
102 views

Sorting posts by custom field value in array

I have a custom field value that is an array and it has date as one of the values: a:3:{s:4:"date";s:10:"03/06/2013";s:6:"target";d:1000;s:8:"currency";s:3:"USD";} I'm trying to sort posts with ...
0
votes
1answer
132 views

Display Custom Field in Sidebar if Value is Present

I'm trying to use 'if' 'else' to display a link button if I have a value in the 'TourURL' custom field, and if not, nothing will display but can't seem to get the if code to work: <?php if(global ...
1
vote
1answer
630 views

Custom Metabox Not Saving

I've simplified a problem of saving custom metaboxes on update and still can't get the box to save the custom-field input to the database. This is the call from functions.php to an external file ...
0
votes
1answer
366 views

Sort categories by meta value

How can I make a list of categories with 4 last posts in each where every category is sorted by meta_value. For example, template without sorting by meta_value is http://pastebin.com/AeH6vx9b It ...
0
votes
1answer
775 views

How to store post meta in an array

I am creating a plugin, where the user can create forms with an unlimited amount of fields. I would like to store each field the user creates as an array in a post meta field. What would the code look ...
0
votes
1answer
140 views

Add Custom Fields After Page Title

I want to add my custom fields after the page title when you view it on the site. How do I do this? PAGE TITLE [CUSTOM FIELDS HERE] PAGE CONTENT
0
votes
2answers
307 views

Custom Theme Fields in Settings Menu - apply filters to one of those fields?

I found an interesting concepts of adding an additional option to the "General Options" in Wordpress. /** * Custom Theme Settings * see http://digwp.com/2009/09/global-custom-fields-take-two/ */ ...
0
votes
2answers
901 views

Any way to include custom fields in WP_Query results?

Looking for a way to include custom fields in the output of WP_Query. I am managing a site where nearly every post type has a lot of custom fields defined and it would be much nicer not to have to run ...
0
votes
1answer
399 views

Custom fields: dropdown values depending on other custom field value

i have custom fields like this: "country" - values: "USA", "Russia", "China" "city" - values: "Chicago", "Moscow", "Beijing" I want when user in custom field "country" choose value "USA" after ...
0
votes
1answer
106 views

KEY and VALUE custom field issue

I have this bit of code for displaying the value of links key of my custom fields. $links = get_post_meta($post->ID, 'links', false); foreach($links as $link) echo '<div class="first-link ...
0
votes
1answer
101 views

RSS Feed in Custom Field

I have a custom field intended for a rss feed. It is simpley a URL in the field, how do I take that url entered and output it into the correct section in the template? <?php include_once(ABSPATH . ...
0
votes
1answer
440 views

How to echo a different field if another field is empty?

I succeeded in getting both images and video to echo into a bootstrap carousel. However, I run into a problem when the post contains no images. If there are no images then there is no class="item ...
0
votes
1answer
109 views

Custom fields with square brackets in the name

I have some custom fields which I need to have square brackets inside. This would not be a problem apart from the fact that I need the end user to be able to reselect the custom field on another post ...
1
vote
1answer
2k views

Custom bulk action for media gallery items

I'm trying to add custom "Bulk Actions" to WP 3.5 new media gallery items. I started from this excellent tutorial which does exactly what I need, but with regular posts; so i tried to adapt it to work ...
0
votes
1answer
1k 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 ...
1
vote
1answer
1k views

WP_Query orderby not working with meta_value_num and menu_order

I have made a custom post type (sidebar_element) which are shown on sidebar. On each sidebar element admin can choose where in sidebar should that element be shown, ie. 'top', 'middle' or 'bottom', ...
0
votes
4answers
933 views

Add additional field to custom post_type

I am trying to add another field (subtitle) to my already created and existing custom post_type: team (code from functions.php in my *child*theme) <?php /** * Custom Post type register framework ...