Andreslav
Forum Replies Created
-
Forum: Plugins
In reply to: [Blocks CSS: CSS Editor for Gutenberg Blocks] The technical CSS classHey @hardeepasrani,
If you can’t do it otherwise, then let it be ??
I just think it’s better to keep this class somewhere inside the plugin/block without bringing it into the interface.
- This reply was modified 1 year, 5 months ago by Andreslav.
Forum: Plugins
In reply to: [Blocks CSS: CSS Editor for Gutenberg Blocks] CSS variables are not supportedHey @hardeepasrani,
Got it. Thank you!
Hello @bhshravankumar,
Thanks!
Forum: Plugins
In reply to: [WooCommerce Blocks] Using the woocommerce_shop_loop hook_*Understood.
Unfortunately, I haven’t found a quick example of how to achieve what I want, so I’ll use shortcodes for now ??
Forum: Plugins
In reply to: [EWWW Image Optimizer] The problem with automatic scalingImproved version. The previous one might not work sometimes.
jQuery(document).on('lazybeforesizes', function (e) { let img = e.target; if(img.dataset.srcset && window.getComputedStyle(img)['object-fit'] == 'cover') { var dxd = img.dataset.srcset.match(/-(\d+x\d+)+\./); if(dxd) { let [w, h] = dxd[1].split('x').map((e) => parseInt(e)); if(typeof w == 'number' && typeof h == 'number') { let width = Math.ceil(e.detail.width * (w / h)); if(width > e.detail.width) { e.detail.width = width; } } } } });
Forum: Plugins
In reply to: [EWWW Image Optimizer] How to reduce the number of options in srcset?@shakargarr Hello! Thanks, but it doesn’t seem to work for me – there is no ewww_image_optimizer_image_pre_data_srcset hook in the plugin (I checked with a file search).
What is the mistake?..
- This reply was modified 1 year, 11 months ago by Andreslav.
Forum: Themes and Templates
In reply to: [Astra] I can’t set a fractional valueHi @bsfherman, I’m talking about this title ??
Forum: Plugins
In reply to: [YML for Yandex Market] Задать категорию товаровПонял, спасибо за плагин!
Forum: Plugins
In reply to: [YML for Yandex Market] Задать категорию товаровДобился необходимого так. Спасибо за крючки!
define('FEED_1_PRODUCT_CAT', [25, 24, 26]); add_filter( 'yfym_query_arg_filter', function($args, $feed_id) { if( $feed_id == 1 ) { if( !isset($args['tax_query']) ) $args['tax_query'] = []; $args['tax_query'][] = [ [ 'taxonomy' => 'product_cat', 'field' => 'term_id', 'terms' => FEED_1_PRODUCT_CAT, 'operator' => 'IN', ] ]; } return $args; }, 11, 3 ); add_filter( 'yfym_args_terms_arr_filter', function($args_terms_arr, $feed_id) { if( $feed_id == 1 ) { $args_terms_arr['term_taxonomy_id'] = FEED_1_PRODUCT_CAT; } return $args_terms_arr; }, 11, 3 );
Если есть иной способ, будет интересно узнать.
Forum: Plugins
In reply to: [Create Block Theme] Found an errorThe second point, apparently, is not related to this plugin. Styles (wp-webfonts-inline-css) are generated by wordpress.
Forum: Plugins
In reply to: [Create Block Theme] Found an errorHi @mmaattiiaass, I noticed two more strange things
- The font in the preview is incorrect. Photo
- In Edge and Chrome (Firefox is fine), I get the thinnest version of the font, regardless of the given weight. It has something to do with local() (if removed, the problem disappears) and the fact that I have locally set the font “Montserrat-VariableFont_weight”.
Windows, Microsoft Edge 111.0.1661.41, Chrome 111.0.5563.65
Forum: Plugins
In reply to: [Create Block Theme] Found an errorHi @mmaattiiaass, thanks!
Forum: Plugins
In reply to: [EWWW Image Optimizer] The problem with automatic scalingOkay, let’s consider the issue resolved.
Maybe someone in the future will find my fragment useful, and they will be able to find it here.
Forum: Plugins
In reply to: [EWWW Image Optimizer] The problem with automatic scaling@adamewww I didn’t understand the question.. I have square images in the gallery (plugin), and I can also use object-fit somewhere so that the images fill a certain area.
Forum: Plugins
In reply to: [EWWW Image Optimizer] The problem with automatic scalingThis snippet kind of does what I need
jQuery(document).on('lazybeforesizes', function (e) { let img = e.target; if(img.dataset.srcset && window.getComputedStyle(img)['object-fit'] == 'cover') { let dxd = img.dataset.srcset.split(',')[0].match(/-(\d+x\d+)+\./); if(dxd) { let [w, h] = dxd[1].split('x').map((e) => parseInt(e)); if(typeof w == 'number' && typeof h == 'number') { let width = Math.ceil(e.detail.width * (w / h)); if(width > e.detail.width) { e.detail.width = width; } } } } });
- This reply was modified 2 years ago by Andreslav.