Garbled HTML pulled for page description “caption id=attachment…”

That’s shortcode with the brackets stripped. And since shortcode is either rendered or removed before output, it suggests that these descriptions are not merely being “scraped” from your site, but provided by a WordPress plugin or locally-hosted script. I would first check your theme is not “leaking” raw shortcode; do you see something like [caption…] … Read more

Post thumbnail dependant on category

You could do this : $categories = get_the_category($post->ID); $cat = $categories[0]->cat_name; if ( has_post_thumbnail() && $cat == ‘news’ ) { the_post_thumbnail(‘medium’); } *EDIT: the code grabs the post category, line 2 grabs cat name from the object and I use it as a condition in if statement *

WordPress Images | How to get the cropped image?

if you have the attachment (image) id, you ca use : wp_get_attachment_image_src( $attachment_id, $size); where $size is the smaller version you want. (see http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src) If you don’t know the attachment id you may query the database for full image size url : http://pippinsplugins.com/retrieve-attachment-id-from-image-url/

Show uploaded images in full size

WordPress creates 3 different sizes as far as my research goes. Read this on WP image handling -> http://www.studiograsshopper.ch/web-development/wordpress-featured-images-add_image_size-resizing-and-cropping-demo/ You can easily customise the default Media sizes by changing the default sizes in Dashboard > Settings > Media. You can grab any of those sizes. See the codex @ http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail The function you want is: … Read more

Uploading Full Size Image vs Resizing Before Upload

If your server has the right libraries the images are resized on upload so the public facing load time should not suffer. You can add image sizes with add_image_size and retrieve those specialize sizes with functions like get_the_post_thumbnail or get_attachment_image_src, among others. There are also a lot of post here about image sizes. You may … Read more

featured images – custom links

Look at the specified link within the featured-image in the last part of your snippet. You’ll have to update the_permalink() with your custom link, too: <div class=”featured-image”> <a href=”https://wordpress.stackexchange.com/questions/106791/<?php echo esc_url( $more_link ); ?>”><?php print_thumbnail( $thumb, $thumbnail[“use_timthumb”], $title, $width, $height, ” ); ?></a> </div> <!– .featured-image –>

Post-upgrade problems: Image URL in DB, but not showing

I don’t have time to produce working code for this. I will edit the answer if I get the chance. In the meantime, you probably want a filter on upload_dir to alter that path. Your code would look something like this then: function alter_upload_wpse_107016($upload) { remove_filter(‘upload_dir’,’alter_upload_wpse_107016′); // alter $upload array return $upload; } if (1 … Read more