Tag Info

New answers tagged

-1

This simply doesn't work. Wordpress resizes the images while uploading, so if you don't upload them again, nothing will happen.


0

You can use the Advanced Custom Fields plugin to add a custom field (an image field) to your custom taxonomy group.


1

Having so many images on one page isn't recommended. You should split the images into smaller galleries and across more than one page (or use pagination) to lower the page load speed for each page. To split a single post in several pages (adding pagination) you can just add using the text editor. Alternatively ensure you're image sizes are not too large ...


1

You can try to crop the image in places you want manually using the WP_Image_Editor class. Here is a simple example $image = 'http://karunshakya.com.np/wp-content/themes/twentyeleven/images/headers/lanterns.jpg'; $img_size = getimagesize($image); $img_process = wp_get_image_editor( $image ); // Return an implementation that extends ...


1

Having a solution: First register thumbnail size in function.php add_image_size( 'cp-thumb', 600, 339, true ); // (cropped) Generate thumbnail while uploading image. Then call it in post loop in following way: <div class="outer-div"> <div class="inner-div"> <?php get_the_post_thumbnail( $thumbnail->ID, 'cp-thumb' ); ?> ...


1

The issue is that when I upload an image that is less than the dimensions 600x339 in either height or width, they show up incorrectly on the page. I did not understand this statement as you wrote it, but when I started researching I found what you meant, so I am writing this answer to document this for others who do not understand your meaning, or how ...


0

Well you can do this 1 of 2 ways. $attachments = get_posts(array( 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => get_the_ID(), 'order' => 'ASC', 'orderby' => 'id', ...


0

It's because wordpress do not use upscale for thumbnails by default. You could use this plugin to solve this problem: https://wordpress.org/plugins/thumbnail-upscale/ It will affect only new uploaded images. To regenerate your old images use this plugin: https://wordpress.org/plugins/regenerate-thumbnails/


1

It sounds like your problem occurs before the image is cropped/ resized and displayed in the page - the original image is too small. You can require minimum dimensions for uploaded images, see: How to Require a Minimum Image Dimension for Uploading? Then, to resize the uploaded image without cropping it, define the image size with a 'soft crop' using ...


0

5 years later... Try this plugin WP Users Media


0

You could add a new image size with a hard crop added however it would be the same crop position for all images, setting them manually would require per image manipulation. add_image_size( 'blog-crop', 375, 0, array( 'left', 'top' ) ); Then reference the new image size in your blog template. Codex reference here: ...


0

Is the css clip property what you are looking for? img { position: absolute; clip: rect(0px,60px,200px,0px); } From CSS clip Property


0

Alignleft looks like it's behaving itself exactly as it should: aligning the image left and the text to the right of it. If you want your left aligned images to behave the same way as you 'align none' image, simply go to your style.css and remove 'float:left' from your .alignleft code: .alignleft { float: left; margin:0 1em 1em 0; } You can also change ...


1

You can use Adaptive images WordPress plugin. It generates images on the fly and cache them. It gives to settings in admin section in which you can specify your breakpoint ( on which it will generate images ). You can also use Picturefill.WP WordPress plugin.


0

As what I've commented, the rawurlencode() function is the reason because WordPress have a lot of restrictions. I found that, that kind of problem will exist if you have a % percent sign (in my case, produced by the rawurlencode()) in your 'default' => $value. One of the solutions, encode some or the whole part of your path with base64_encode(): $encode ...


0

I found that there's a predefined WordPress function to upload a file into the Media Library but it's only working asynchronously with a <form> element and a $_FILES array. Second, I also found that there's a second imagepng() parameter filename which is the path where you want to save the file. I tried to save it to a WordPress uploads' path such ...


0

Its really looks like templates in your news-events section are use Featured image, and next (a same as first image) - just inserted into post body contents as Image. I Suggest you to remove featured image ( but not to delete it from wp), in this case you will avoid using duplicated image, un till you decide how its should be used with your wordpress ...


0

I would try a couple of things: Check the image itself, I've come across jpg images that have malformed headers so on my linux based desktop (Xubuntu) i can't open them in Thunar/Ristretto but can open them in GIMP. Try re-uploading (after a DB/File backup) the WordPress core files again, perhaps one of them was corrupted during upload/unpacking?


1

If this is still a problem, then you can find my answer on wordpress.org's support forum, it might help: wordpress.org/support/topic/resize-failure-on-some-images-with-odd-message This is a part of a code from the jQuery library, to be specific this part is responsible for handling callbacks. It is displayed, because the reponse from wordpres is ...


0

Just add frame: 'post', to wp.media attributes.


0

Since you're not currently running a multi-site install, you can either install the WP-REST-API plugin which is currently in beta, or you can wait for it to hit core which will probably be around version 4.3 or 4.4. If you were on a multi-site install, you could have easily used the switch_to_blog() function to switch between blog databases to query ...


0

If you have access to install, or if it is available on your server I would recommend using WP-CLI. It has a command to regenerate the media: wp media regenerate If not, you can try a plugin such as Regenerate Thumbnails Good luck!


0

Marketplace is rather void of a plugin to enhance this workflow. My designer team wants to clip random parts of any page, which means copy as URL etc aren't going to do the job. I'm sort of surprised this isn't in the core yet. https://wordpress.org/plugins/image-elevator/ seems to be the most trustworthy choice so far. Another plugin, Imagepaste, looks ...


1

This function will generate an image by temporarily registering an image size, generating the image (if necessary) and the removing the size so new images will not be created in that size. function lazy_image_size($image_id, $width, $height, $crop) { // Temporarily create an image size $size_id = 'lazy_' . $width . 'x' .$height . '_' . ((string) ...


2

You can optimize uploaded image in wordpress by EWWW Image Optimizer. This plugin giving facility for bulk optimization. So you can compress and optimize image very easily. Also this plugin optimize images according proportion. So optimized image not losing quality. It is very best plugin for image optimization.I am currently using this plugin.


1

To load images from the location you currently have them stored use get_site_url() to generate a path: $a = date('md').".jpg"; $a = get_site_url(null,'images/'.$a); // var_dump($a); Then use that information to create an img tag. I would recommend loading the images from a theme folder, if this is part of a particular theme. If that is the case use ...



Top 50 recent answers are included