Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Width & height of images is not set
(1 viewing) (1) Guest
"ARI Stream Quiz" WordPress plugin
Go to bottomPage: 1
TOPIC: Width & height of images is not set
#68294
Width & height of images is not set 2 Years, 6 Months ago Karma: 0
Hi, I’ve just checked my pages with your quizzes through Google Pagespeed. There is a notification, that quizzes’ images don’t have width and height set.

So I added width: 612px and height: auto in your custom css tab only for images in questions (all the images there have the same proportions). And the code works.

However, the notification from Pagespeed did not disappear. I guess, the code has to be added straight to html through php, not through css?

Is there any way, how can I add the proportions there (at least manually through code?).
The administrator has disabled public write access.
 
#68300
Re:Width & height of images is not set 2 Years, 5 Months ago Karma: 748
Hello,

Open <wordpress_folder>/wp-content/plugins/ari-stream-quiz/includes/views/quiz-session/tmpl/image.php template file and replace the following code:

Code:


<img <?php if ( $lazy_load ): ?>src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-src="<?php echo $image->url; ?>" class="lazy-load"<?php else: ?>src="<?php echo $image->url; ?>"<?php endif; ?> alt="" />



with the following one:

Code:


<img <?php if ( $lazy_load ): ?>src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-src="<?php echo $image->url; ?>" class="lazy-load"<?php else: ?>src="<?php echo $image->url; ?>" width="<?php echo $image->width; ?>" height="<?php echo $image->height; ?>"<?php endif; ?> alt="" />



Regards,
ARI Soft
The administrator has disabled public write access.
 
#68301
Re:Width & height of images is not set 2 Years, 5 Months ago Karma: 0
Thank you, the code works!

But both width and height have to be set in custom css tab in order it to work properly. However, I wrote above, that I set only width. Height has "auto" rule. If I will set height in px, then it will be the same on every device, and it will look bad.

Is there any way how to adapt your code to 'height: auto;' rule?
The administrator has disabled public write access.
 
#68303
Re:Width & height of images is not set 2 Years, 5 Months ago Karma: 0
So, any thoughts on this?
The administrator has disabled public write access.
 
#68310
Re:Width & height of images is not set 2 Years, 5 Months ago Karma: 748
The plugin generates responsive content (including images) so it doesn't matter what in "width" and "height" attributes of <IMG> tag. The image will be scaled based on screen size. The plugin adds 'height: auto' to images in CSS styles.

Regards,
ARI Soft
The administrator has disabled public write access.
 
Go to topPage: 1