Comments (9)
hey @clicknathan would you be able to paste in some code demonstrating the issues you're seeing?
from wp-tevko-responsive-images.
Sure! The 920x450 being added twice I figured out was not an issue with the plugin, but with my CDN and caching, so that is not an actual issue.
Regarding HTTPS, here's the output on a single blog post page's Featured Image:
<img width="920" height="616" src="https://wandrlymagazine.com/wp-content/uploads/2015/02/DSC08242-920x616-920x616.jpg" srcset="http://wandrlymagazine.com/wp-content/uploads/2015/02/DSC08242-920x616-420x281.jpg 420w, http://wandrlymagazine.com/wp-content/uploads/2015/02/DSC08242-920x616-920x616.jpg 920w, http://wandrlymagazine.com/wp-content/uploads/2015/02/DSC08242-920x616.jpg 920w" class="attachment-large wp-post-image" alt="a hitchhiker wanders through an amusement park">
Which I'm just calling with the_post_thumbnail('large'); in a /inc/content-partial.php file that is in turn called via get_template_part( 'assets/inc/content-partial' ); in single.php (if that would in any way matter, can't imagine why it would).
On lines 75-86 of wp-tevko-responsive-images.php I was trying to change this to:
// Loop through each size we know should exist
foreach( $default_sizes as $key => $size ) {
// Reference the size directly by it's pixel dimension
$image_src = wp_get_attachment_image_src( $id, $key );
if(strpos($image_src[0], 'http:') === 0) {
return str_replace('http:', '', $image_src);
}
$arr[] = $image_src[0] . ' ' . $size['width'] .'w';
}
return $arr;
But my PHP is not good enough and alas, I'm coming up short.
from wp-tevko-responsive-images.
Wait, just saw that return
in there, this seems to be working for me:
// Loop through each size we know should exist
foreach( $default_sizes as $key => $size ) {
// Reference the size directly by it's pixel dimension
$image_src = wp_get_attachment_image_src( $id, $key );
if(strpos($image_src[0], 'http:') === 0) {
$image_src = str_replace('http:', '', $image_src);
}
$arr[] = $image_src[0] . ' ' . $size['width'] .'w';
}
return $arr;
from wp-tevko-responsive-images.
Hi @clicknathan,
Could you tell me if your site url is set using an http:// or https:// scheme? In other words, when you look in your admin under Settings > General, is the WordPress Address for your site using HTTPS?
Thanks,
Joe
from wp-tevko-responsive-images.
I do have http, not https. Probably the issue?
On Sun, Mar 8, 2015 at 4:34 PM Joe McGill [email protected] wrote:
Hi @clicknathan https://github.com/clicknathan,
Could you tell me if your site url is set using an http:// or https://
scheme? In other words, when you look in your admin under Settings >
General, is the WordPress Address for your site using HTTPS?Thanks,
JoeReply to this email directly or view it on GitHub
#57 (comment)
.
from wp-tevko-responsive-images.
It's possible. There are many internal functions in WordPress that build your image URLs based on your site url settings. This should be improved in the next version of WP, but for now you may want to try switching to HTTPS if you have a valid certificate and see if that fixes it.
from wp-tevko-responsive-images.
Hi @clicknathan – were you ever able to see if changing your site_url
resolved your issue?
from wp-tevko-responsive-images.
Closing, @clicknathan feel free to open a new issue if you find anything strange
from wp-tevko-responsive-images.
Related: https://wordpress.org/support/topic/broken-images-in-chrome
from wp-tevko-responsive-images.
Related Issues (20)
- `the_post_thumbnail()` not returning `srcset` attributes. HOT 2
- Function to output responsive images in themes HOT 1
- Should we increase the default of 'max_srcset_image_width'? HOT 1
- Update documentation of 'wp_get_attachment_image_sizes()'
- Incorrect inline documentation HOT 2
- Problem with filter deprecation notices HOT 1
- Test test_tevkori_filter_content_images() failing against WP nightlies HOT 2
- Full URL path to files HOT 1
- Add custom srcset + sizes values to post thumbnails? HOT 1
- Incorrect srcset for retina images in 3.1.0 HOT 1
- Image tags without ending slash are never made responsive. HOT 4
- wp_calculate_image_srcset(): Reduce accepted aspect ratio difference HOT 2
- Default theme image options can make test fail HOT 2
- Responsive images broken on edited/imported content HOT 1
- Update documentation about plugin features HOT 2
- Problem with WooCommerce images HOT 4
- Use custom sizes attribute with the_post_thumbnail HOT 5
- Backport WP 4.4.1 fixes. HOT 1
- Deprecate/remove calls to `_wp_upload_dir_baseurl()`
- Plugin compatibility with PHP 8.0 | Imagick 3.5.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wp-tevko-responsive-images.