Open benediktdertinger opened 6 years ago
Hi benediktdertinger!
I was able to reproduce this issue to (for once! 😂)
But if I added a settings array containing the retina => true
option, I got it to work. Can you verify that this is the case for you to please?
echo rwp_picture( $image['id'], array(
'retina' => true
) );
Oh, I just realized that this behavior is expected. When you call the rwp_img()
or rwp_picture()
functions directly, they don't care about your settings. They are only applied when RWP makes images responsive inside the loop.
The rwp_
functions are meant to be used when you wanna do something a bit more custom, if you understand what I mean.
@stefanledin thank you so much for your help and fast reply. Finally it's working! Your plugin works really great but to be honest it wasn't clear at all that I would have to set this setting explicitly. I think there could be 2 options to make this easier to understand:
rwp_*()
inherit this option. Of course this could be then overwritten locally to not use the retina option.Please note that for custom usage of
rwp_image()
andrwp_picture()
you have to set the retina option separately e.g. in your coderwp_picture($image['id'], array('retina' => true));
I would go for the first option as I expected this and it seems (at least to me) to most convenient solution. Also because I use the acf plugin and therefore have to define it in all occurrences by hand.
Hope this helps and keep on doing great stuff – Thank you! <3
Thanks for the feedback, I think I'll keep it as it is for now and going for alternative two :) I'm currently thinking about the future of the plugin and considering if I should go for RWP 2.0 or just maintaining the current state...🤔
Is it also the case that when you add an extra filter using rwp_add_filters
that images processed through that filter ignore the RWP retina setting?
Unfortunately, in my experience, it seems to be.
Humm, no, the same settings should be applied on images that goes through the extra filters as the ones that goes through the_content
.
Is everything else working as expected, besides retina?
Sorry, I think I was wrong. I was looking for a display density descriptor in the img
markup, but I guess that's not needed if you are specifying sizes (?). When I switched the plugin's settings to the picture
element, I can see that it is in fact doing the right thing.
Hello everyone,
I got the following setup:
I turned on the retina, picture markup and debug options in the plugins settings. I followed the all the instructions in the readme and related pages. The pictures have been created for my custom images sizes and the related retina sizes. Find debug details here:
My
function.php
adaptions look like this:Everything seems to work fine except for adding the retina
srcsets
. I tried all kinds of options and combinations but nothing worked. The picture was added like this (content comes from acf plugin):echo rwp_picture($image['id']);
Could you please help me? – Thank you in advance!