Create a custom post type for a photo post
If you want just a title and an image I suggest you put this argument when registering the custom post type -> ‘supports’ => array( ‘title’, ‘thumbnail’ ),
If you want just a title and an image I suggest you put this argument when registering the custom post type -> ‘supports’ => array( ‘title’, ‘thumbnail’ ),
…or try this: // … put your $today and $future variables here… global $wpdb; $events = $wpdb->get_results( ” SELECT * FROM {$wpdb->posts} LEFT JOIN( SELECT DISTINCT post_id, (SELECT CAST(meta_value AS DATE) FROM {$wpdb->postmeta} WHERE {$wpdb->postmeta}.post_id = meta.post_id AND meta_key =’opening_time’) AS opening_time, (SELECT CAST(meta_value AS DATE) FROM {$wpdb->postmeta} WHERE {$wpdb->postmeta}.post_id = meta.post_id AND meta_key =’artist_talk_time’) … Read more
The issue is that you are using get_post_meta(), but since you’re hooking wp_insert_post_data you have not set the post meta yet (because the hook fires before the post is inserted into the database. You should be pulling from the metadata submission, and running through any filters you use for update_post_meta(). If you post the code … Read more
This line… imgurl = jQuery(‘img’,html).attr(‘src’); Means that jQuery is getting the “source” (i.e. full path) of the image. As you’ve guessed, that won’t work for a PDF file. What you’ll probably have to do is get the id of the attachment instead. Could you possibly update your original answer with the HTML SOURCE of the … Read more
It’s not enough to define areas and put metaboxes in them, you must define the layout via the current screen. For example, when displaying a dashboard esque widget area on my custom option page, the first things I have are: global $screen_layout_columns; add_screen_option(‘layout_columns’, array(‘max’ => 3, ‘default’ => 3) ); $screen = get_current_screen(); wp_enqueue_script( ‘dashboard’ … Read more
yeah, the question is a bit unclear. but i think you need shortcode attributes function get_custom_field_fn( $atts) { global $post; extract( shortcode_atts( array( ‘meta’ => ” ), $atts ) ); $custom_field_value = get_post_meta($post->ID, $meta, true); return $custom_field_value; } add_shortcode(‘cf_name’, ‘get_custom_field_fn’); see the codex: http://codex.wordpress.org/Shortcode_API#Attributes
usually you need to global $custom_metabox; $custom_metabox->the_meta(); as described in the alchemy docs. however i can’t tell more unless you post your code.
I was looking at this answer earlier. It shows you how to remove fields from the Media Uploader, so maybe it’ll set you on the right lines for writing an additional function to incorporate into the Uploader?
If you really want to have only one post id and a value attached to it, well i think it will be better to store in options table using add_option and then using it using get_option….. that way you will be saved from headache of updating all posts meta at once when any of post … Read more
The logic here is incorrect: // Verify this came from the our screen and with proper authorization, because save_post can be triggered at other times if ( !isset( $_POST[‘mrlpt_client_check’] ) && !wp_verify_nonce( $_POST[‘mrlpt_client_check’], ‘mrlpt_submit_client’ ) ) { return; } This reads if the $_POST[‘mrlpt_client_check’] is not set and is invalid – return. You want it … Read more