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

learn more… | top users | synonyms (2)

3
votes
1answer
64 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
10 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
84 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 ...
0
votes
0answers
92 views

Admin Filter by custom field

I use this for make a filter for post in my admin, on a specific custom post type, but it don't work, the query don't update and i get an empty list add_action( 'pre_get_posts', ...
0
votes
1answer
142 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
0answers
69 views

Adding Custom field in a signup form not working

I have used the following code in functions.php to add some custom field to my registration form and add it to the db in the wp_usermeta table. But dont know why it is not working. I am using a custom ...
0
votes
0answers
25 views

How make a link to meta_key for all meta_value

I have a meta_key = 'company', where meta_value = name of the company that introduces the user to order form. Then these companies appear on the publication page (index-job.php). How make a link the ...
0
votes
0answers
14 views

Altering query to return more data

I am building a web app with WordPress. I have a situation where every time I do a while ($query->have_posts()), I immediately do a get_field('due_date'). I'm using advanced custom fields. This ...
0
votes
1answer
191 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
50 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
46 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 ...
0
votes
0answers
101 views

Combine Two Plugins to Filter by Custom Taxonomy and Custom Field

I'd like to give my users the possibility to filter the posts by Categories, Tags, and Custom Field values. Search/filter form would be multiple fields: Field One City:[categories with a parent ...
1
vote
2answers
89 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
49 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
104 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?
-1
votes
0answers
82 views

How to display custom post types by custom taxonomy in while loop?

I am using Posts 2 Posts to display a custom post type on a page. Document status, document author and feedback due date are custom fields. Package is a custom taxonomy. I want to display my custom ...
0
votes
1answer
76 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 ...
2
votes
1answer
221 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
44 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
73 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
51 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
55 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
82 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
158 views

Notice: Trying to get property of non-object [closed]

i have a vote plugin and im trying to display the most voted posts on a "Charts" section the plugin has a built in command with <?php MostVotedAllTime(); ?>. I'm trying to edit the way its ...
0
votes
1answer
57 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
86 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
79 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
94 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
64 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
117 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
47 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
59 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
83 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
38 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
254 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
98 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
123 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
228 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 ...
1
vote
1answer
104 views

Better post meta efficiency?

I work with websites which require using Post Meta for Post Objects within a particular Post Type. I often add a Meta Box to a particular Post Type, to provide additional settings for the new Post ...
1
vote
1answer
287 views

How can i create a function to get youtube video time

Tom J Nowell posted this code to help me retrieve the YouTube video time. Functions // function to parse the code from the URL function parse_youtube_video_id_from_url( $video_url ) { ...
2
votes
3answers
112 views

Function to change meta value in database for each post

I have a meta key called 'prijs' in each post. The value of this meta key consist of numbers in the follow structure: 2,100.00 I want to remove the comma in the meta value to get this output: 2100.00 ...
2
votes
1answer
90 views

Save HTML formatted data to post meta using add_post_meta()

Array ( [post] => Array ( [jw_objective] => Exposure to e<b>nd to end development</b> of various applications; right from requirement analysis to system ...
0
votes
1answer
34 views

How to insert post into a page?

i created a custom_post_type: add_action('init', 'event_register'); function event_register() { $labels = array( 'name' => _x('Pacotes', 'post type general name'), 'singular_name' => ...
0
votes
1answer
462 views

Use ACF to display a customizable WooCommerce product add to cart button

WooCommerce is notorious for not being all that customizable (except for templating that is a seriously convoluted process). So, I am attempting to use Advanced Custom Fields (plugin) to create an ...
0
votes
1answer
44 views

custom header text

I am creating a custom website by modifying the twenty-eleven theme. I want to create custom text in the header area that is unique to each page. Is there a way to add a 'description' to each page and ...
0
votes
2answers
80 views

get_post_custom_values not working

I have made a custom template to show the posts in "Products" category in a single page.I have some custom fields.I need to show the values of the custom fields in the page. I have used the ...
0
votes
1answer
110 views

Importing from XML is ignoring serialized custom field

I have been trying to import something into a custom field using the WordPress Import tool but it seems to be leaving the custom field empty in the database. ...
0
votes
1answer
34 views

Footnotes in custom fields

I am using Jquery Hover Footnotes plugin that allows adding footnotes and dynamically displays them on hover-over. In other words, I use {{FOOTNOTE_NUMBER}}, Then I embrace the actual footnote text ...
0
votes
2answers
36 views

Cannot Hide Google Map if custom field is blank

I am using the following to display google maps using hotel_address custom field. <iframe width="440" height="400" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" ...
1
vote
1answer
408 views

How to sort CPT by custom meta value (date), and return posts month by month

For future reference: I am using the great Meta Box Plugin to help expedite meta box creation for my custom post types. My goal: To build a highly customizable events section closely resembling a ...

1 3 4 5 6 7 26