Articles of custom field

Alternative to simple fields plugin?

I have been building websites with WordPress for a couple years now, and have become very reliant on the Simple Fields Plugin. Essentially this plugin lets me attach extra fields to the bottom of my “edit” pages; for example: repeatable image upload fields, extra text fields, etc… This plugin is currently out-of-date and does not […]

How to Display Custom Meta Box only on Specific Page IDs

I am using Magic Fields 2 for custom meta boxes and custom fields, but this situation pertains to any meta box. I have a custom meta box that I want to display on only 3 specific page IDs. function mf_1_remove_meta_boxes() { if( !in_array($_GET[‘post’], array(‘194′,’185′,’2’) ) ): remove_meta_box( ‘mf_1’, ‘page’, ‘normal’ ); } UPDATE Using Bainternet’s […]

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 user is in the trail I want to add “Trial” at the top and […]

Calling custom fields for pages (not posts)

I’m trying to place a small code in my template header.php file. I want to get a custom field value. I’m trying to call custom fields from current page outside of loop, btw. I have no problem doing this when I need to get custom field values from posts, but I can’t seem to do […]

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 updated. I need to do this in order to make a frontend posting solution work […]

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 […]