Tag Info

New answers tagged

1

By using wp_get_attachment_image_src() function get the original url of thumbnail if ( has_post_thumbnail() ) { $image_url = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); $image = $image_url[0]; } Then add Image Url to your custom code <a href="<?php echo $image; ?>"><img class="alignright size-medium ...


1

If you know the image's ID : wp_get_attachment_image( $image->ID, array(200, 112) ); returns an HTML img element or empty string on failure. The entire code could be something like : <a href="<?= get_attachment_link( '5435' ); ?>"> <?= wp_get_attachment_image( '5435', array(200, 112) ); ?> </a>


-2

You are probably missing ImageMagick (PHP extension). Install it and the JPG artifacts will be gone.


0

Here is my working solution. The code is documented, so it should be clear what each function does. I pretty much use the wp_generate_attachment_metadata filter to create the needed images after the image has been uploaded. The generated images are listed in the metadata too, like any other intermediate image size. That way you can pretty much work with ...


0

Its probably best to create a child theme and make this change in the child theme...otherwise, when a new update for the twenty fourteen them comes out, it will revert back to 474px.



Top 50 recent answers are included