Tagged: x
-
AuthorPosts
-
June 26, 2016 at 5:42 pm #1060468
pruzickaParticipantHi,
is this (https://www.smashingmagazine.com/2015/12/responsive-images-in-wordpress-core/) implemented in X ? When I upload image to WP, it would create several images with different size but I’ve found out that WP would use only one (the biggest one) for featured image and for the one used in post. Also this size would be used for all viewports, mobile or biggest screen in my house.
Is this how it’s supposed to work ?
ThanksPetr R.
June 26, 2016 at 9:10 pm #1060733
RadModeratorHi Peter,
Thanks for writing in.
That feature is disabled on X theme. X theme uses its own registered image sizes due to the nature of theme’s responsiveness. But if you wish to enable it, please add this code to your child theme’s functions.php
function x_disable_wp_image_srcset( $source ) { return true; }Thanks!
June 27, 2016 at 9:04 am #1061541
pruzickaParticipantHi Rad,
thanks a lot. I’ve done that but I see no change š cache cleared etc.). What exactly is should do ?Petr
June 27, 2016 at 9:41 am #1061609
ThaiModeratorHey There,
Please add the following code instead:
function x_enable_srcset( $source) { return true; } add_filter( 'wp_calculate_image_srcset', 'x_enable_srcset' );Hope it helps š
June 27, 2016 at 4:54 pm #1062246
pruzickaParticipantThank you, once again, I see no change.
June 28, 2016 at 12:41 am #1062733
LelyModeratorHi There,
Please use this code instead:
function x_disable_wp_image_srcset( $source ) { return true; }Hope this helps.
June 28, 2016 at 9:56 am #1063323
pruzickaParticipantHi Lely,
isn’t this the code from the first response ?Petr
June 28, 2016 at 10:00 am #1063330
JoaoModeratorHi Petr
Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thanks
Joao
June 28, 2016 at 10:33 am #1063402
pruzickaParticipantThis reply has been marked as private.June 28, 2016 at 12:59 pm #1063653
DarshanaModeratorHi there,
Please refer to the following detailed response here (https://community.theme.co/forums/topic/enable-srcset/#post-1043395).
Thanks!
June 28, 2016 at 2:42 pm #1063799
pruzickaParticipantInterestingly enough, page not found. I’ve tried to find it via search, got the hit bust still – page not found. But thanks for hint anyway.
Petr
June 29, 2016 at 12:10 am #1064338
ChristopherModeratorHi there,
I’m sorry the thread is private, I put answer here :
The responsive srcset feature from WordPress was disabled with intent and much decision weighing things out as we have had our own responsive image calculations in place for X that take into account things that WordPress cannot due to the nuances of the theme. That being said, we can understand that you may wish to utilize this feature, even though we do not currently support it. For now, you will need to leave your fix in place in the core files of the theme, but in the next release we have made this function āpluggableā so that you can overwrite it via your child theme. When the next release is out, if you go to /functions/global/admin/thumbnails/setup.php you will see at the bottom of the file this block of code:
if ( ! function_exists( 'x_disable_wp_image_srcset' ) ) : function x_disable_wp_image_srcset( $source ) { return false; } add_filter( 'wp_calculate_image_srcset', 'x_disable_wp_image_srcset' ); endif;Again, this will be in the next release, not this current one. To overwrite this when the update is out, you can add your own x_disable_wp_image_srcset() function to your child themeās functions.php file, which will keep this one from disabling the responsive srcsets. That might look something like this in your child theme:
function x_disable_wp_image_srcset( $source ) { return true; }Simply overwriting the function should also remove the add_filter call from X as that is also wrapped inside the if statement.
Do keep in mind that this is not a feature we support in X, so enabling responsive srcsets again means that we will not be able to assist in any formatting or functional issues that might arise because of this, but we want to make sure that you at least have a clean way to do this via your child theme if desired. Hopefully this helps and donāt hesitate to let me know if you have any further questions.
Hope it helps.
June 29, 2016 at 12:52 am #1064360
pruzickaParticipantgreat, thanks a lot
Petr
June 29, 2016 at 1:28 am #1064379
NicoModeratorHappy to hear that.
Feel free to ask us again.
Thanks
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1060468 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
