Can an image have more than one parent_post?

Images can only be attached to a single post, and they only get attached to the post they were originally uploaded to, and only if it was uploaded to a particular post to begin with. The only way to know if an image is used by a post is to parse the HTML of the … Read more

How can I upload an image for background use using the Theme Editor in WordPress?

Giving the CSS of background #FFFFFF url(‘images/newbackground.gif’); is just giving an example based on basic CSS. Be careful when copying the suggestions made in the book because you missed an important colon after background. It should be background: #FFFFFF url(‘images/newbackground.gif’); Also, you need to make sure the URL part of the CSS is correct for … Read more

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