wp_get_attachment_image function size argument not working if I also add a custom class

Just as Tom mentioned in the comments above. The fourth parameter of wp_get_attachment_image sets the value, not adds to it so it will override the auto generated class. If you need the size class and your custom class you can simply add both of them manually like so… echo wp_get_attachment_image( $image_id, ‘image-size’, ”, [ ‘class’ … Read more

WooCommerce single products images doesn’t zoom on hover and doesn’t change clicking on gallery

my solution works for who makes a theme from zero (not using WordPress ready themes) make a Backup from your WordPress theme go to wp-content/plugins/woocommerce and find and copy a directory which name is templates into wp-content/themes/your-theme and rename it to woocommerce in your theme directory, create a file and name it woocommerce.php and add … Read more

Link to large image version instead of original?

You can modify the content that is displayed on the site by hooking in to the the_content filter. However, this is where the hard work starts. You need to identify all the images, figure out the links to the large sizes, and replace them. This could be a costly operation, so you might want to … Read more

Image as a link using wp_nav_menu()

Use CSS to add an image instead of text see: http://wpweaver.info/menu-bar-and-background-images/ http://en.forums.wordpress.com/topic/cutline-gt-coraline-replacing-menu-items-with-graphics http://wpveda.com/how-to-add-images-inside-wordpress-3-0-custom-menu/

How do I let users upload files to a chosen location?

In PHP, instead of: <form method=”POST” action=”url”> Use this instead: <form enctype=”multipart/form-data” method=”post” action=”url”> You can then fetch the resulting files using the $_FILES superglobal. In WP 3.1, the whole uploads infrastructure should be available as an API unless I’m mistaking. But it won’t necessarily work on the front end, let alone allow you to … Read more

Special purpose photos with each post

Well one photo can be assigned as the thumbnail as you can see in the post editor screen. Otherwise as the comment above suggested create a post meta field for example ‘my_post_image’ and place the id of the image attachment in that field. That is how WordPress saves the post thumbnail (look in the database, … Read more

Images don’t show up

Finally, I’ve got it! Sniffing the HTTP resonses indicated that a few extra bytes were being inserted between the headers and body of the http response, resulting in bad image data. Further investigation revealed that these characters represent a Unicode Byte Order Mark (BOM). These, in turn, were caused by a Windows editor that saved … Read more

Imported thumbnails have incorrect URL

The easiest way is to use the Cache Image plugin, which ‘sideloads’ images in your posts that are from other domains. I’ve had mixed results, mainly because it seems to not work well for thousands of posts and images – if your site is smaller you may have better results.