Code Monkey home page Code Monkey logo

Comments (9)

tevko avatar tevko commented on June 13, 2024

hey @clicknathan would you be able to paste in some code demonstrating the issues you're seeing?

from wp-tevko-responsive-images.

clicknathan avatar clicknathan commented on June 13, 2024

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.

clicknathan avatar clicknathan commented on June 13, 2024

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.

joemcgill avatar joemcgill commented on June 13, 2024

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.

clicknathan avatar clicknathan commented on June 13, 2024

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,
Joe

Reply to this email directly or view it on GitHub
#57 (comment)
.

from wp-tevko-responsive-images.

joemcgill avatar joemcgill commented on June 13, 2024

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.

joemcgill avatar joemcgill commented on June 13, 2024

Hi @clicknathan – were you ever able to see if changing your site_url resolved your issue?

from wp-tevko-responsive-images.

tevko avatar tevko commented on June 13, 2024

Closing, @clicknathan feel free to open a new issue if you find anything strange

from wp-tevko-responsive-images.

joemcgill avatar joemcgill commented on June 13, 2024

Related: https://wordpress.org/support/topic/broken-images-in-chrome

from wp-tevko-responsive-images.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.