February 23, 2013 at 2:59 pm #8627
I am using wp_lightbox_prettyPhoto_image
I would like to know how to set Size Attributes (ie width=”355″ height=”200″) to the image that are embedded in my posts. The image is in fact w355 h200, and the purpose of this is to optimize my site for google page speed.
I have tried using the way I would do it ordinarily in HTML, but the attributes do not end up in on the site when after I publish.
Please let me know, thanks!
[http://www.aquariumcarebasics.com/]February 23, 2013 at 4:03 pm #54024
Here is what I am using in my post:
[wp_lightbox_prettyPhoto_image link="http://www.aquariumcarebasics.com/aquarium-pictures/o-ring-sizes.jpg" img class="alignleft size-thumbnail wp-image-83" description="Always keep a couple spare O Rings on hand in case of a filter emergency." source="http://www.aquariumcarebasics.com/aquarium-pictures/o-ring-sizes-355x200.jpg" title="O Rings Come In Many Different Sizes"]
And no matter where I put width=”355″ height=”200″ the attributes do not make it into the webpage.
Any insights would be appreciated!February 23, 2013 at 10:44 pm #54025
Hi, by “embedded image” do you mean the shortcode anchor image or the image that will pop up in lightbox?
If you want to resize the anchor image please follow the instructions on this post:February 26, 2013 at 1:25 pm #54026
I am trying to set the dimensions for the anchor image that appears on the website that a visitor clicks on NOT the image that opens up in the pop-up window.
When I place width=”355″ height=”200″ in the code those attributes do not make it into the site when published.
Thanks in advance!
[http://www.aquariumcarebasics.com/]February 26, 2013 at 10:25 pm #54027
I followed the instructions in this link but it did not work.
For some reason I cannot get the attributes to work with the shortcode.
I CAN set size attributes when I hardcode with < >, but the syntax does not work from within the [ ] of the shortcode.
Any insight would be appreciated.
Thanks!February 26, 2013 at 10:36 pm #54028
Hi, can I have a look at your shortcode after the changes you have made?
Please create a separate page with just one shortcode so I can see what is actually happening.February 28, 2013 at 5:32 am #54029
Here is the test page:
And here is the shortcode:
[wp_lightbox_prettyPhoto_image link="http://www.aquariumcarebasics.com/aquarium-pictures/00-720-405-placeholder.jpg" img class="alignleft size-thumbnail wp-image-24" description="INSERT DESCRIPTION" source="http://www.aquariumcarebasics.com/aquarium-pictures/00-720-405-placeholder-355x200.jpg" width="355" height="200" title=" INSERT TITLE"]
When I use firebug to check out what is on the webpage, the width and height are not set. And I get this suggestion from GT Metrix:
The following image(s) are missing width and/or height attributes.
[http://www.aquariumcarebasics.com/aquarium-pictures/00-720-405-placeholder-355×200.jpg] (Dimensions: 355 x 200)
Any insights would be appreciated!
Thanks!February 28, 2013 at 10:51 pm #54030
Hi, you are doing it wrong. The link I shared explains how you can use the img_attributes parameter in the shortcode to apply HTML attributes to an anchor image. please use the shortcode like the following:
[wp_lightbox_prettyPhoto_image link="http://www.aquariumcarebasics.com/aquarium-pictures/00-720-405-placeholder.jpg" description="INSERT DESCRIPTION" source="http://www.aquariumcarebasics.com/aquarium-pictures/00-720-405-placeholder-355x200.jpg" img_attributes='width="355" height="200"' title="INSERT TITLE"]March 1, 2013 at 4:20 am #54031
Hey, it worked! I cant thank you enough! Great plugin and great support!
- You must be logged in to reply to this topic.