SQL query – get ids – Advanced Custom Fields / WPeC

Thanks for your help s_ha_dum, I had a look at the table structure using phpMyAdmin, ACF Plugin saves fields to the postmeta table, so sb_wpsc_meta needed to be changed to sb_postmeta. also needed to change what was being SELECT to post_id aswell as the meta_value to 1. final query; “SELECT post_id FROM sb_postmeta WHERE `meta_key` … Read more

Invalid file type when using wp_upload_bits to upload PDF to a custom post type

Ahh I figured it out. After echoing and print_r every single thing I could I figured out that this line: $uploaded_file = wp_upload_bits($_FILES[$pdf_field[‘name’]], null, file_get_contents($_FILES[$pdf_field[‘tmp_name’]])); Needed to be changed to this: $uploaded_file = wp_upload_bits($pdf[‘name’], null, file_get_contents($pdf[‘tmp_name’])); The original problem I had in the first place was not being able to pass my $_FILE array directly … Read more

Is it possible to have hierarchical taxonomy and hierarchical custom post types in one permalink?

To cut a long story short the answer to the question is Yes. In the end I was able to create: tax-1/tax-2/cpt-1/cpt-1-post/cpt-2/cpt-2-post/ and another structure: tax-1/tax-2/cpt-1/cpt-1-post/cpt-2/custom-field/cpt-2-post/ I used Types from http://wp-types.com/ to create the hierarchical custom taxonomy, the custom post types, custom fields, but most importantly the parent/child relationship between custom post types. That plugin … Read more

Function to add custom HTML into head in custom post-type list page

If its okey you can hook into admin_notices. Like this: Change post_type to the real post_type name.. I assumed it would be “program”. function wpse_76471_add_html() { global $pagenow ,$post; if( $post->post_type == ‘program’ && $pagenow == ‘edit.php’ ) { $output=”<div class=”my-div”>”; $output .= ‘<h2>’. __(‘My custom content (HTML/PHP)’, ‘program’) .'</h2>’; $output .= ‘</div>’; echo $output; … Read more