Articles of custom field

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 unset($user_contactmethods[‘jabber’]); unset($user_contactmethods[‘yim’]); unset($user_contactmethods[‘aim’]); unset($user_contactmethods[‘googleplus’]); unset($user_contactmethods[‘url’]); unset($user_contactmethods[‘twitter’]); // And add any news ones. The array key is the meta key name, the text // is however you want it labelled — keep […]

How to show custom field's value under post/page title in wp-admin

I’m trying to add the value of a custom field under the post/page title in wp-admin list of posts/pages (much like excerpt mode in posts list) without hooking into the columns process since other plugins are already doing that and it looks like each cancels the other. Here’s a screenshot of what I’m trying to […]

Using new WP_Query in shortcode in a custom field causes the main post content to not display

I’ve got a custom post type of files I’m trying to list using a new WP_Query. It works fine when I add the shortcode within the main post content. However, when I add the shortcode to a custom field (which I have set to display on the page along with the main content as a […]

How can I combine meta_query queries?

I’m trying to build combined meta_query queries but they don’t work. Any ideas how I can implement queries like the example below? Thanks, Hinnerk Array ( [relation] => AND [0] => Array ( [key] => price [value] => 1000 [type] => numeric [compare] => <= ) [1] => Array ( [relation] => OR [0] => […]

Delete all custom fields at once?

I have about 50 custom fields I need to delete at once, going through each one and deleting one at a time would take too long because it takes about 4 seconds for a page to load and I just don’t have time to do that. I need to delete them because I previously used […]

Enable sticky posts to custom post_type

i have this custom post_type: tvr_apartment function custom_post_apartment() { $labels = array( ‘name’ => ‘Apartments’, ‘singular_name’ => ‘Apartment’, ‘add_new’ => ‘Add New’, ‘add_new_item’ => ‘Add New Apartment’, ‘edit_item’ => ‘Edit Apartment’, ‘new_item’ => ‘New Apartment’, ‘all_items’ => ‘All Apartments’, ‘view_item’ => ‘View Apartment’, ‘search_items’ => ‘Search Apartments’, ‘not_found’ => ‘No apartments found’, ‘not_found_in_trash’ => ‘No […]

Rewrite custom post type url's adding meta box values

I’ve got these custom post types (CPT) and meta boxes: Movies (CPT) Genre (Meta box) Genres (CPT) If one movie is called Die hard then I want the permalink to be: /genres/action/die-hard This is easily fixed by setting the movie-CPT to ‘rewrite’ => false and use this code instead: add_action(‘init’, ‘rb_add_rewrite_rules’); add_filter(‘post_type_link’, ‘rb_create_permalinks’, 10, 3); […]

Adding a custom field into the_content()

Anyway to add a custom field into the_content() somehow? I have the AddThis plugin on my site and it shows up at the bottom of my site right before my custom field, I would like my custom field to show up at the very end of the_content() and then have the AddThis stuff show up. […]

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 case multiedit_Info), it will populate in the “target” page. Here’s my code that I […]

Custom fields in Permalinks?

I’m wondering how to add a custom field value to a custom post type’s permalink? For example, I have the custom post file ex: cpt-cities.php, which handles registering the custom post type and all of those specifics. Within that file, I’m trying to set it’s permalinks to include one of the ‘cities’ custom field values. […]