images not showing despite using add_theme_support(‘post-thumbnails’);

Since you appear to be using Featured Images, replace this: <div class=”post-image”> <?php echo ravs_get_custom_image( get_post_thumbnail_id () ); ?> </div><!– end post-image –> with this: <div class=”post-image”> <?php if ( has_post_thumbnail() ) { the_post_thumbnail( ‘custom-image’ ); } ?> </div> References Codex: has_post_thumbnail() the_post_thumbnail()

Dynamic image crop in WP 3.0+?

http://codex.wordpress.org/Class_Reference/WP_Image_Editor http://codex.wordpress.org/Function_Reference/wp_get_image_editor $image = wp_get_image_editor( ‘cool_image.jpg’ ); if ( ! is_wp_error( $image ) ) { $image->rotate( 90 ); $image->resize( 300, 300, true ); $image->save( ‘cool_image.jpg’ ); } Repalce cool_image.jpg with a variable holding the path to the image you want to edit. Not a copy and paste solution but should put u on the right … Read more

Featured Image If Else Condition

Change your code to: <div id=’xpro_shell_text’ > <?php if ( has_post_thumbnail( $post->ID ) ) : $imageInfo = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘single-post-thumbnail’ ); $imageUrl = $imageInfo[0]; else: $imageUrl = get_template_directory() . ‘PATH TO YOUR DEFAULT IMAGE’; endif; ?> <div id=”xpro_shell_content_header” class=”content_about_us_header white” style=”background:url(‘<?php echo $imageUrl; ?>’) no-repeat;”> <div id=’xpro_shell_content_header_blurb’> <h1 class=”greenHeader cufon_reg”> <?php the_title(); ?> … Read more

How to disable thumbnail filter for a specific template part or image size?

Probably the simplest solution is to remove the filter before output: // remove the filter remove_filter(‘post_thumbnail_html’, ‘_sf_responsive_img’, 5, 5); // output template get_template_part( ‘something’ ); // add the filter back on if other code below outputs thumbs that need the filter add_filter(‘post_thumbnail_html’, ‘_sf_responsive_img’, 5, 5);

Create a post from every image in my media gallery

If you have the image in your media library you can just loop trough them and create post via wp_insert_post. function import_post_from_imgs() { $images = get_posts(‘post_type=attachment&post_status=inherit&posts_per_page=-1’); // just a minimal security check if ( ! current_user_can(‘publish_posts’) ) return; if ( ! empty($images) ) { foreach ( $images as $image) { // prevent duplicate if for … Read more