Why isn’t is_home() working correctly?
is_home() won’t work until wp_query is run. The earliest hook you can use where is_home will work is ‘parse_query’, but ‘template_redirect’ would be better.
is_home() won’t work until wp_query is run. The earliest hook you can use where is_home will work is ‘parse_query’, but ‘template_redirect’ would be better.
Add a column to the post edit screen and format the date however you like. Remove the default Date column. EDIT here’s the code to put inside your theme’s functions.php file: EDIT 2 added additional code to add publish status and make the column sortable, this should now be a complete copy of the original … Read more
The problem here is that you don’t allow PHP to read more than one value, because all values use the same name site_options[categorychoice], so they overwrite each other, and the last one wins. You need more brackets. Set the name attribute of your select element to site_options[categorychoice][], and all values will be read by PHP.
Use wp_handle_upload() to handle uploads yourself, without creating attachments or resizing. The media_handle_upload() function actually creates an attachment post, and the resizing process happens when wp_generate_attachment_metadata gets called. If you don’t call that, then no resizing occurs.
You could indeed, achieve everything with categories, but is it a good idea? If all main categories are 2010, 2011, 2012 and each of them has subcategories named Room1, Room2, etc., you would indeed have an easy way to make your searches by year or by room. The search by year would be as simple … Read more
You can use this code function your_slug_edit_media_custom_checkbox( $form_fields, $post ) { $form_fields[‘custom_field’] = array( ‘label’ => ‘Custom Field’, ‘input’ => ‘text’, ‘value’ => get_post_meta( $post->ID, ‘_custom_field’, true ) ); return $form_fields; } function your_slug_save_media_custom_field( $post, $attachment ) { update_post_meta( $post[‘ID’], ‘_custom_field’, $attachment[‘custom_field’] ); return $post; } add_filter( ‘attachment_fields_to_edit’, ‘edit_media_custom_checkbox’, 11, 2 ); add_filter( ‘attachment_fields_to_save’, ‘save_media_custom_checkbox’, … Read more
Make sure that the javascript loaded by your load-scripts.php is waiting for the document to finish loading before attaching all of the listeners. When you created a separate function the code ran only a tiny bit earlier, but it was probably early enough for the elements to finish loading and the listeners to properly attach.
Look no further, then. It’s one of the joys of lack of referential integrity combined with workflow bugs. Please report this in the WP bug tracker.
my plugin: http://wordpress.org/extend/plugins/mediapicker-more-rows/ I found a way to fix the pagination There is a way you can ‘hook’ into paginate_links. There is no official hook for it, but you can change the $wp_query->found_posts variable. What I did here is ‘hooking’ into the paginate_links by abusing the media_upload_mime_type_links filter and setting a new value for $wp_query->found_posts. … Read more
You can do this via a filter. Add the following to functions.php. You can also add your own fields this way… // edit fields in media upload area add_filter(‘attachment_fields_to_edit’, ‘remove_media_upload_fields’, 10000, 2); function remove_media_upload_fields( $form_fields, $post ) { // remove unnecessary fields unset( $form_fields[‘image-size’] ); unset( $form_fields[‘post_excerpt’] ); unset( $form_fields[‘post_content’] ); unset( $form_fields[‘url’] ); unset( … Read more