Hey Warriors, I am having a problem specifying the width and height using the printf command.
Using Printf Command - Width and Height problem
9
Hey Warriors,
I am having a problem specifying the width and height using the printf command.
The code is as below:
When I perform speed analysis using GTMetrix, it says that "image(s) are missing width and/or height attributes." If I put it as follows:
then I get printf function error saying too few arguments in printf function.
If I delete the width and height specifications from here and put it in the stylesheet, still it does have the same warning in GTMetrix
Please help me to correctly specify the size in this command so that it doesn't give warnings in GTMetrix
I am having a problem specifying the width and height using the printf command.
The code is as below:
Code:
printf('
<a href="'.get_term_link( $term ).'" style="color:%s;" data-javo-category="%s">
<img src="%s" style="width:300px; height:200px;">
<span style="font-size:%s'.'px;">%s</span>
<div class="categories-wrap-shadow"></div>
<div class="inner-meta %s">
<!-- <div>%s</div> -->
<!-- <small>%s</small> -->
<div class="cat-title">'.$term->name.'</div>
<div class="cat-des">'.$term->description.'</div>
<?php endif; ?>
</div>
</a>'
, $title_text_color
, $term->term_id
, $featured
, $category_size
, $term->name
, ( $display_item_count == 'hide' ? 'hidden' : '' )
, $term->name
, javo_get_count_in_taxonomy( $term->term_id )
); When I perform speed analysis using GTMetrix, it says that "image(s) are missing width and/or height attributes." If I put it as follows:
Code:
width="300" and height="200"
If I delete the width and height specifications from here and put it in the stylesheet, still it does have the same warning in GTMetrix
Please help me to correctly specify the size in this command so that it doesn't give warnings in GTMetrix
- ripsnorta2
- [1] reply
- keyuria
- [2] replies
- keyuria
- [1] reply
- geekSoftware
- [1] reply
Next Topics on Trending Feed
-
9