Image dimensions not specified

January 2013 WordPress Theme
GK User
Thu Feb 07, 2013 8:05 pm
I am using GK News Show Pro. It generates thumbnails for which image dimensions are not specified. Google recommends that image dimensions should be specified. Any solution for this?
User avatar
Senior Boarder

GK User
Fri Feb 08, 2013 7:33 am
Hi,

In the gavern/widgets.nsp.php you have to find function generate_art_image and change line:

Code: Select all
return '<a href="'.$art_url.'" class="gk-responsive gk-image-link" '.$style.'><img src="'.$new_path.'" alt="" class="gk-nsp-image gk-responsive" /></a>';


to:

Code: Select all
return '<a href="'.$art_url.'" class="gk-responsive gk-image-link" '.$style.'><img src="'.$new_path.'" alt="" class="gk-nsp-image gk-responsive" height="'.$this->wdgt_config['article_image_h'].'px" width="'.$this->wdgt_config['article_image_w'].'px" /></a>';
User avatar
Administrator

GK User
Fri Feb 08, 2013 1:57 pm
Not working, may be because the widget shows cached images

like this url http://mysite.com/wp-content/themes/New ... _nsp-6.jpg
User avatar
Senior Boarder

GK User
Sat Feb 09, 2013 11:34 am
Sorry I forgot to add these attributes in the second place, please replace:

Code: Select all
if($this->wdgt_config['article_image_pos'] == 'left' && $this->wdgt_config['article_image_order'] == 1) {
             return '<div class="gk-nsp-image-wrap"><a href="'.$art_url.'" class="gk-image-link" '.$style.'><img src="'.$new_path.'" alt="" class="gk-nsp-image" height="'.$this->wdgt_config['article_image_h'].'px" width="'.$this->wdgt_config['article_image_w'].'px" /></a></div>';
          } else {
             return '<a href="'.$art_url.'" class="gk-responsive gk-image-link" '.$style.'><img src="'.$new_path.'" alt="" class="gk-nsp-image gk-responsive" height="'.$this->wdgt_config['article_image_h'].'px" width="'.$this->wdgt_config['article_image_w'].'px" /></a>';
          }


with:

Code: Select all
if($this->wdgt_config['article_image_pos'] == 'left' && $this->wdgt_config['article_image_order'] == 1) {
    return '<div class="gk-nsp-image-wrap"><a href="'.$art_url.'" class="gk-image-link" '.$style.'><img src="'.$new_path.'" alt="" class="gk-nsp-image" /></a></div>';
 } else {
    return '<a href="'.$art_url.'" class="gk-responsive gk-image-link" '.$style.'><img src="'.$new_path.'" alt="" class="gk-nsp-image gk-responsive" /></a>';
 }
User avatar
Administrator

GK User
Sat Feb 09, 2013 11:53 am
I can't find this code anywhere in the file.
User avatar
Senior Boarder

GK User
Sat Feb 09, 2013 11:58 am
The code at the bottom should be the one that should be replaced and not the one at the top.
Also doing that gives 500 internal server error.
User avatar
Senior Boarder

GK User
Sat Feb 09, 2013 1:46 pm
Please just use the attached file ;)
User avatar
Administrator

GK User
Sun Feb 10, 2013 2:57 pm
Thanks it worked. However, I am using 4 News Show Pro Widgets on my website and it is working for only one plugin and not for all.
User avatar
Senior Boarder

GK User
Sun Feb 10, 2013 5:48 pm
Please re-save the configuration of the rest of the widgets.
User avatar
Administrator

GK User
Sun Mar 31, 2013 10:12 am
Hi dziudek,
I just wonder why you haven't integrated this fix in the february update, and the ticket is still open in GitHub. Do you want me to fix it and send you a pull request?

Regards,
Thomas.
User avatar
Fresh Boarder

GK User
Mon Apr 01, 2013 10:09 pm
@tbarthelet - most probably the v.1.6 was frozen, that's why I've added it to the v.1.7 ToDo, I've merged your pull request :)
User avatar
Administrator

GK User
Sat Nov 16, 2013 8:59 pm
This issue is happening again with News v1.4
User avatar
Senior Boarder

GK User
Sun Nov 17, 2013 12:46 pm
I don't know why it wasn't added, I'll report this topic to the developer who maintenance our themes.
User avatar
Administrator


cron