Removing width and height attributes from wp-get-attachment
You might have better luck using wp_get_attachment_url( $id ) rather than wp_get_attachment_image(). Take a look at the WordPress codex for the call.
You might have better luck using wp_get_attachment_url( $id ) rather than wp_get_attachment_image(). Take a look at the WordPress codex for the call.
I believe there are some root-links that you haven’t changed. Please follow these steps Login to admin section www.xyz.com/wp-admin Navigate to settings->general-> and change the ‘Site Address (URL)’ and ‘WordPress Address (URL)’. Also please check the permalinks and settings->media there is an upload directory and the default wordpress location is wp-content/uploads, check if it is … Read more
I think that the best option here would be to disable the generation of additional image sizes on adding an image to the media library. Doing so is fairly straight-forward: Visit the Settings > Media page of your WordPress dashboard. Under the Image Sizes section, change all of the values to 0. Save the changes. … Read more
When you insert an image to the post you see Add media modal dialog. It has a field named Link URL with three buttons underneath, including None to remove the link. Screenshot:
Basically the img_caption_shortcode filter allows you to completely replace the default image caption. If you want to do that, you’ll need to ask WP to pass all the argument of the filter to your callback function. <?php add_filter(‘img_caption_shortcode’, ‘wpse81532_caption’, 10, 3 /* three args */); Then your callback will need to take care of all … Read more
No, not strictly. You can check the source and see that there is no hook that would let you alter the URL. You should also notice this interesting bit of code: 512 if ( $image = image_downsize($attachment_id, $size) ) 513 return $image; Follow the trail to here and you get this: 141 // plugins can … Read more
This sounds like a description of the JetPack’s Photon service. Photon is an image acceleration and modification service for Jetpack-connected WordPress sites. Converted images are cached automatically and served from the WordPress.com CDN. Images can be cropped, resized, and filtered by using a simple API controlled by GET query arguments. When Photon is enabled in … Read more
You can add custom class to post thumbnails. the_post_thumbnail accepts array of attribute $attr where you can specify image class. So your code will be. <div class=”home-featured-img”> <?php if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it. the_post_thumbnail( ‘full’, array( ‘class’ => ‘responsive-class’ ) ); // show … Read more
There used to be an issue with WordPress – but that should have been fixed 5 years ago: Preserve PNG transparency/alpha during thumbnail creation If you’re using a newer WP installation (which I suppose) this issue might be rather a problem with the GD library of your server than with WordPress. And as far as I know … Read more
They are not the same. In the 800×350 image, a little bottom is cropped. This is how the hard cropped work: First, it scales your image to match your image size. It can be width or height. Your size is 800×350 If your original image scaled according to 800px width has the 400px height (bigger … Read more