Removing Title Tag from Thumbnails

This filter will remove it completely from all images, you can add a conditional to only effect certain images. function remove_img_title($atts) { unset($atts[‘title’]); return $atts; } add_filter(‘wp_get_attachment_image_attributes’,’remove_img_title’); Instead if you want to use <?php the_post_thumbnail( ‘category-thumb’ ); ?> You can pass it an empty title using the second $attr so your title tag will look … Read more

WordPress resizes image to the same size as uploaded

If you are uploading images the same size as the large size in your WordPress installation, then set your Large size to 0x0 in Settings -> Media or remove this line: add_image_size( ‘large-size’, $LARGE_SIZE, 9999 ); EDIT #1: Try to add this filter to delete the original image: add_filter(‘wp_generate_attachment_metadata’, ‘delete_fullsize_image’); function delete_fullsize_image($metadata) { $upload_dir = … Read more

How can i place Feature Image under title field in wp-admin?

Super late to the party, but well… If you want to show your featured image right under the Post title in your Admin area, use this piece of code in your functions.php : add_action(‘do_meta_boxes’, ‘my_cpt_move_meta_box’); function my_cpt_move_meta_box(){ remove_meta_box( ‘postimagediv’, ‘post_type’, ‘side’ ); add_meta_box(‘postimagediv’, __(‘custom name’), ‘post_thumbnail_meta_box’, ‘post_type’, ‘normal’, ‘high’); } Be sure to change post_type … Read more

How to handle thumbnails

Since WordPress 2.9, you can add thumbnail support to your theme by adding this to the theme’s functions.php file: if ( function_exists( ‘add_theme_support’ ) ) { add_theme_support( ‘post-thumbnails’ ); } When this is done, you’ll be able to add a feature image to your post on Posts, Pages or Custom Post Types. You’ll see the … Read more

Show current page featured image in sidebar

I’m assuming you’re going to be outputting this on a singular page (Post, Page, Attachment)? If so, the easiest thing to do is to put your post AND sidebar content inside the Loop, so that you have access to the $post global, and post-related template tags. Alternately, you could define a variable, inside the Loop, … Read more

Posts Page Featured Image [closed]

I feel like such an idiot!! I was trouble-shooting this last night and I guess I removed the featured image for the news page…so, of course, the image wasn’t showing up! I added the featured image and the following code: <?php if(is_home()) { ?> <?php $page_for_posts = get_option( ‘page_for_posts’ ); echo get_the_post_thumbnail($page_for_posts, ‘large’); ?> <?php … Read more

How to get custom image sizes into media uploader dropdown?

Try seperating it like this: function setup_image_sizes() { if ( function_exists( ‘add_image_size’ ) ) { add_image_size( ‘post-image’, 608, 350, true ); } } add_action( ‘after_setup_theme’, ‘setup_image_sizes’ ); function post_image_sizes($sizes){ $custom_sizes = array( ‘post-image’ => ‘Post Image’ ); return array_merge( $sizes, $custom_sizes ); } add_filter(‘image_size_names_choose’, ‘post_image_sizes’); That way it is working in my setup. Additional Sources: … Read more