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

learn more… | top users | synonyms (2)

0
votes
1answer
3k views

How to get source of custom meta image?

I'm working on a CPT (custom post type) page template and would like to get the source of custom meta image. For post_thumbnail's this is rather easy using wp_get_attachment_image_src(), but if I ...
2
votes
2answers
3k views

Advanced Custom Fields Validation

Is there way to use custom validation on an advanced custom field? For example, I might not want a textfield to have a value that starts with certain prefix, or I might want a number field to have a ...
0
votes
1answer
242 views

How do I filter a custom post type loop by a field?

OK, very simple task, I'm just not good at PHP. I have a page where I want to list some staff using a styled list. Here is the page all working fine, I just need to divide the results - ...
3
votes
2answers
2k views

How do I paginate search results for custom post types?

I have a Custom Post Type called "cars" that stores several custom fields along with the standard Title/Description fields. I need users to be able to search through the CPT based on the custom fields ...
1
vote
1answer
107 views

Custom Field returning Numerical Value for Image rather than URL

I have been trying a way round my latest WordPress problem all morning and I feel now is the right time to shout and ask for help. I have been trying to create a people directory, I'm there except ...
1
vote
1answer
222 views

Custom Fields - Taller editing area

Don't know if this is possible, but can the custom fields be adjusted to be taller in the admin panel? It's a bit tedious to have to stretch the textbox every time you want to edit an existing field ...
0
votes
1answer
380 views

List custom field values ​​in alphabetical order without repetition

The function below lists the custom fields as in this example: Frank Capra Alfred Hitchcock Woody Allen Woody Allen Frank Capra Pedro Almodóvar Pedro Almodóvar I introduce the values ​​in ...
2
votes
2answers
4k views

Multiple orderby values in WP_Query

I'm trying to come up with a query to sort by multiple orderby values. Here's what I have so far: $dept_id=2; $query=new WP_Query(array( 'post_type'=>'wpcontactus', ...
4
votes
1answer
216 views

Prevent reload confirmation after AJAX save

I am saving information in the admin panel via ajax. The problem I'm running in to is the "Are you sure you want to navigate away from this page" popup appear, even though everything has been saved. ...
0
votes
1answer
38 views

“After file loaded” action

I have a plug-in that allows for repeatable fields. There will be an image and the image description. The description allows for tinyMCE editing. There are obviously problems with this, but I think I ...
0
votes
1answer
79 views

How would I attach media/images to a post based on a ID stored in a each post's custom field

I have converted a site over to wordpress recently. I was able to import all the posts via a CSV importer, but not the images associated with each post. The post type is "machinery". The custom ...
4
votes
1answer
354 views

Using get_post_meta with new_to_publish

I'm trying to read the custom fields set by the user when publishing a new post: function doSomething($post) { $meta = get_post_meta($post->ID); error_log("post meta: ".print_r($meta, ...
0
votes
1answer
304 views

WP_Query () using taxonomy, custom post types

I want to implement this query using WP_Query(). SELECT * FROM wp_posts as posts LEFT OUTER JOIN wp_postmeta as postmeta ON (postmeta.post_ID = posts.ID) LEFT OUTER ...
0
votes
1answer
134 views

WP-eComerce Advance Meta Tag data in descending order [closed]

I am use WP-Ecommerce plugins for ecommerce support Now i am set custom meta like this and it will display in ascending order like this so i need to display it in descending order how can i do ...
0
votes
1answer
591 views

How to check for specific meta box value on front end and output accordingly

I have a custom meta box with two different radio buttons that can be selected. One is for displaying the content in a "large' format, the other is for displaying content in a "small" format on the ...
1
vote
1answer
155 views

how to fetch the meta field keys/meta boxes from a post type?

I need to find all the meta keys or meta boxes preferably from just a post type ...couldn't find any wordpress function to do this. Any custom queries?
1
vote
2answers
2k views

How to add a predefined custom field without using a plugin?

I´m trying to find a snippet to add a predefined custom field. Does anyone know how or where i can find this? I know I can do this with CustomPress, but I´m trying to do this without a plugin.
0
votes
1answer
130 views

Custom meta box includes

I am having some problems including files for my custom meta boxes. I have a structure like so: post-meta.php cmb teaser_meta_box load.php initiate.php display.php save.php So ...
1
vote
1answer
277 views

Searching Custom Fields

I would like to know how I can set up a form (separate from the normal search form), that will allow me to search through a particular custom post type. Within my defined custom post type I have 2 ...
0
votes
1answer
350 views

Geocoding an Exploded Custom Field Array

So, I'm having a little problem with crossing signals in WordPress between Google Maps' API and an exploded custom field. I want to be able to geocode an address that's been exploded from a custom ...
0
votes
1answer
255 views

Loop to display random posts only if a custom field matches category

Working on a website and need loop that will show posts ONLY if custom field value is equal to the current category name. I have category 'fun' and custom field 'genre'. I would like to show on ...
1
vote
1answer
2k views

get_pages sort alphabetically by meta value

I operate a real estate website, and I have a list of homes we are selling. I am using a bunch of custom fields to store information about the homes. When you click on a home in the home listing page ...
0
votes
2answers
362 views

Split the_title

Is there a way to just split the_title into two different lines without a custom field? The titles in my blog are like small header above the maintitle. The Problem is, that at the moment I am ...
0
votes
1answer
190 views

Querying meta values within an array

Okay so I'm using the relationship field from Advanced Custom Fields against a custom post type. The relationship lists countries, when these are saved they are within a serialised array: [country] ...
2
votes
1answer
805 views

Wordpress Search documentation: how to improve search query using taxonomy terms, custom meta fields?

I'm trying to understand how Wordpress search works. I haven't found much info on the Codex. Arguably, search is not the best WP feature. Even Wordpress.org uses Google Search. I would like to make a ...
0
votes
1answer
545 views

Adding external field to my post form (admin side) and to post show (frontend side)

I would like to add a "Source" field to my posts form so I can show from where I get the published info. Didn't know if this exists already because I'm just starting with WP. So I do some research and ...
1
vote
1answer
1k views

How to get a meta value from all post

I searched for a while but I didn't find any solution. I used the functions listed here. It outputs something like this: Array ( [0] => 15 [1] => 30 [2] => 50 ) But I want ...
1
vote
2answers
680 views

custom field to always to .get_the_title()?

Is there a way to have always the the_title(); tag also includes a custom field called subtitle? I want to have a title like this: "subtitle-custom-fild: Posttitle" Like "Cool: The new TV show from ...
1
vote
1answer
570 views

Use meta_query to get title of associated post

I have two post types that I've associated in one direction by assigning Post A as a custom meta field of Post B. I need to search based on the titles of Post A and return the associated Post B ...
0
votes
1answer
1k views

Create & Save multiple Meta-boxes

I created a custom-post-type and multiple metaboxes which needs to be saved. I have a function that saves one metabox, but I can't figure out how to reuse this function to save all the metaboxes. ...
1
vote
1answer
323 views

Metabox with multiple fields added by user and upload box

I'm trying to build system, where user can add as many fields as he needs to the post. I'm using code from this thread. Everythings works fine, except I can't get my upload working. Here's code I've ...
0
votes
1answer
719 views

Adding extra fields to front end signup form

I've been reading around and looking for a front-end signup form (not using plugins!) and came across this - ...
-1
votes
1answer
27 views

Add Field To All Pages

I'm trying to add a custom field to the built in Page content type. I've found lots of tutorials on how to do this for a single page, but I want to do this for all pages in my theme. Please point me ...
0
votes
1answer
1k views

$wpdb query a post type within a specific taxonomy term while ordering posts by custom meta value?

I have a custom post type 'event', a custom meta field 'event_date' and a custom taxonomy 'locations'. I want to query $wpdb to retrieve posts in this way posts must be of the 'event' post type ...
0
votes
1answer
98 views

Filtering posts by WORD in custom field

I need to filter my posts in categories pages, by showing only posts that have specific WORD in custom field value. I need php code that i should add in loop for this category. Details: I need loop ...
2
votes
1answer
183 views

how to save multiple custom fields for a post in one go?

I want to save multiple custom fields for a custom post in one go. Something like get_post_custom() except for that I need to set it this time.
3
votes
1answer
3k views

passing argument to get_template_part() or a better way to code

I have this include … event-list.php <?php /** * The loop that displays upcoming events */ ?> <ul class="event-items"> <?php $yesterday = time() - 24*60*60; $args = array( ...
3
votes
1answer
2k views

Search ONLY by meta key / meta values

I'm almost there on this one. On functions.php i have this: function base_home_product_post_type( $query ) { if($query->is_search() && $_POST['box'] == 'sku') { ...
0
votes
2answers
509 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
2answers
43 views

Can You Build Page Templates Without Extra Files

I'm very familiar creating page templates in WP and for this project I really just have one page template with an option to switch the sidebar from the right side to the left side. The problem is that ...
0
votes
1answer
635 views

Problem uploading different files as custom fields with front end post form

I have a front end post form that I'm having some problems getting the right path for the media to save as custom fields. The path to the file gets saved as ...
0
votes
1answer
875 views

Order custom posts by taxonomy, then by meta_key

I've created a custom post type called Player Manager, where I have all the players of a football team. The CPT has four different categories - goalkeepers, defenders, midfielders and strikers. I also ...
4
votes
2answers
5k views

How to validate custom fields in custom post type?

I wrote a plugin that creates a custom post type with custom fields. To prevent users from entering incorrect information, how can I validate the data? I assumed that the save_post hook function ...
4
votes
1answer
308 views

Storing meta fields multiple times OR once with multi dimensional array?

I got some options that I expand using a repeater type field. The values I save for each field is already an array so in essence I'm saving a multi dimentional array per option. (See this weekly ...
0
votes
1answer
2k views

How do I insert a custom field in a user submitted post?

Please help! I have a form for users to submit posts, and I want them to be able to choose photos already in the media gallery based on category selected. I want to include radio buttons to choose ...
1
vote
1answer
727 views

Add Paypal Button programmatically

I've setup a post type-Product with custom fields containing price and other attributes. I'm reading Paypal Documentation right now, What i've read till now is "HTML-Buttons" can be pasted from ...
0
votes
1answer
95 views

How to change order of posts in admin

Hi I have set a custom post type with some custom fields, one of the custom fields is a date field which is different from the publish date of the post itself, which is by default used by WordPress to ...
1
vote
2answers
133 views

Plugin for custom posts and fields [closed]

I need a plugin to do the following: Add custom posttypes such as "Books" or "Cars" Add custom fields such as "Url", "Label", "Number of wheels", "Name of passenger" or "Age of passenger" There ...
1
vote
1answer
58 views

Delete custom fields when deleting posts

When I delete a bunch of posts their custom fields remain in the database, is there a way to remove them as well on deletion?
1
vote
1answer
403 views

search also in taxonomy, tags and custom fields

I have found many answers separately for Taxonomy, Custom fields and Tags, most of them outdated. But how to combine a search in: - designed custom fields of a custom post - custom taxonomy terms - ...