Articles of custom field

Order by value in serialized custom field

Quite a pesky problem here. I’ve taken over a site that contains multiple information, serialised, within a custom field. For example: if ($new_query->have_posts()) : while ($new_query->have_posts()) : $new_query->the_post(); $ids[] = get_post_custom( get_the_ID() ); print_r($product_custom_fields[‘item_data’]); endwhile; endif; Would return something along the lines of: {i:0;s:0:””;s:13:”regular_price”;s:4:”1000″;s:10:”sale_price”;s:0:””;s:6:”weight”;s:0:””;s:10:”tax_status”;s:7:”taxable”;s:9:”tax_class”;s:0:””;s:12:”stock_status”;s:7:”instock”;s:12:”manage_stock”;s:3:”yes”;s:10:”backorders”;s:2:”no”;} I’d like to be able to run a query that orders […]

Populate Custom Field Dropdown on Theme Install?

Is there a way to populate the custom field dropdown box when you install a theme? I want to make it easier for users and avoid having them add the terms manually when they first set it up.

Take Variables Set in Functions.php and Echo Them Inside My Custom Post Template

I have the following function set up in my functions.php file to allow my custom post type “Slideshow” to work. add_action( ‘the_post’, ‘paginate_slide’ ); function paginate_slide( $post ) { global $pages, $multipage, $numpages; if( is_single() && get_post_type() == ‘lom_slideshow’ ) { $prefix = “slide{$i}”; $multipage = 1; $id = get_the_ID(); $custom = array(); $pages = […]

Related links – from other sites

I’m in middle of re-building a website that’s coded in a rather terrible custom CMS. Since the site is essentially a blog, I’ve been doing it in WordPress. One thing I’d like to do is be able to add a few “related links” to each post. These links are not the same thing as “related […]

Display info from custom fields in all images' HTML

Okay, I’ve been working on this all day and can’t find the solution anywhere. I’ve created a custom field within the image upload screen (info first found here). The field stores the name of a photographer to give him/her credit. Everything’s fine there. What I can’t figure out is how to get this information into […]

WP_Query display next custom post from today's date

I have a calendar plugin that uses custom posts types to create events. There are several custom fields that allow me to create various and seemingly unlimited post queries. The one I’m currently focus on is the field containing the “event start date”, titled = evcal_start_date. What I need to do is display the next […]

How to put enctype=“multipart/form-data” in categories form?

I had success putting the code below to include enctype (for images) in custom post type forms, but I’m not able to use it in categories form… is this possible? Thanks. add_action( ‘post_edit_form_tag’ , ‘post_edit_form_tag’ ); function post_edit_form_tag( ) { echo ‘ enctype=”multipart/form-data”‘; }

Importing users to Buddypress with custom fields

Here’s the setup: The client uses a proprietary custom-coded PHP CMS and is wanting to move to WordPress with BuddyPress. The old, custom CMS has a roster functionality, which I’m using BuddyPress custom fields to replace. The custom fields are basic contact info (Phone, Fax) and company info (Text field). What is the best way […]

WordPress Custom Fields by category

let’s say I have 100 categories and each has 10 custom fields for it self,for example : category Computer : Cpu – Hard – Ram – … category TV : resolution – inch – usb support – … … now I want the editor only can see related custom fields to post(ex. computer) , I […]

wp_handle_upload error “Specified file failed upload test” but still creates attachment?

Having a bit of trouble with an image upload custom meta box. What happens is the uploaded image is created as an attachment but the wp_handle_upload seems to kick back the error “Specified file failed upload test” rather than updating my post meta? Seem odd though that the attachment is created without issues? Heres the […]