Allow users to contribute images to a post

i have got quite a good solution for you, if i get you right: you want to display an upload box for a visitor at your site, enabling him to save images into the wordpress library, and have them labeled as useruploads or something. first step would be to create a form on the post … Read more

Setting default image size

The original image size (i.e. ‘full’) is never modified. Intermediate image sizes are controlled in various places: Default image sizes ( ‘thumbnail’, ‘medium’, ‘large’ ): core settings, via Dashboard -> Settings -> Media Custom image sizes: Theme functions.php file, via add_image_size() Post Thumbnail size ( ‘thumbnail’ ): Theme functions.php file, viaset_post_thumbnail_size()` By default, the ‘large’ … Read more

How to only publish posts with image in it

I found and modified a chunk of code found here: http://www.wprecipes.com/wordpress-tip-detect-if-a-post-has-at-least-one-image. <?php while ( have_posts() ) : the_post(); $content = $post->post_content; $searchimages=”~<img [^>]* />~”; preg_match_all( $searchimages, $content, $pics ); $iNumberOfPics = count($pics[0]); if ( $iNumberOfPics > 0 ) { //your loop content goes here } endwhile; ?> I think this just looks for images entered … Read more

Only show image from custom field when present

<?php $imageid = get_post_meta($post->ID, ‘imageembed’, true); if($imageid != ”) { ?> <div class=”newsimage”><img src=”https://wordpress.stackexchange.com/questions/57967/<?php echo wp_get_attachment_url( $imageid ); ?>” width=”640″ /></div> <?php } ?> Use if condition to check if $imageid has any value in it or not.

Link listings with image

Why not use Links Categories? There you can use images, descriptions, create categories and sort out everything. There would be no need to create a widget as you can use the default WordPress one. Case you were to create your own widget, you can query these items with WordPress functions.

Remove link on full-size images

If you’re adding the full size image from the Post Editor, when you select the image from the media manager pop-up box, you’ll click the button that says “None” under the Link URL field. That would be impossibly messy to control programatically. Well, maybe not impossible, but probably something that you would just hack with … Read more

Custom image size mixes width and height in output

The “medium” and “large” are not custom image sizes – they are already part of the core WordPress media sizes and they should be handled via the “settings” -> “media” options page in wp-admin. Give your custom image sizes a different and more unique name (reserved are thumbnail, medium, large, full)