How to place an image into header.php? [closed]

Don’t use a relative URL. If you look at the source you are probably trying to load the image from http://sitename.com/images/ when what you likely want is http://sitename.com/wp-content/themes/themename/images/. Assuming the image is in the theme directory in a folder that shares a directory with style.css, do this: <img id=”topL” src=”https://wordpress.stackexchange.com/questions/78271/<?php echo get_stylesheet_directory_uri(); ?>/images/img01.png”/> http://codex.wordpress.org/Function_Reference/get_stylesheet_directory_uri

Has wp_get_attachment_image_src changed from 3.2.1 to 3.5.2?

Try this first Make sure that the post in question has its Featured Image (formerly Post Thumbnail) set. Then… Going by our comment thread, here’s something else to try. function gangmei_get_the_post_thumbnail_url($post_id = NULL) { /* * global $id; * $post_id = (NULL === $post_id) ? $id : $post_id; * $src = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), ‘full’); * $src … Read more

custom image size with New Media Manager in wordpress 3.5

You will need to paste your code in order for us to review where the issue is, however, I can demonstrate how I accomplish this in WordPress v3.5 Please observe the comments in my_insert_custom_image_sizes: function my_insert_custom_image_sizes( $sizes ) { // get the custom image sizes global $_wp_additional_image_sizes; // if there are none, just return the … Read more

Re-process Images

When you insert an image into a WordPress post, its display size is determined by the size setting you pick on the insert dialog: If your server is configured to support WordPress’s image resizing (most common hosts configure their servers so this isn’t an issue), a resized version of the image you enter should be … Read more

Removing Title Tag from Thumbnails

This filter will remove it completely from all images, you can add a conditional to only effect certain images. function remove_img_title($atts) { unset($atts[‘title’]); return $atts; } add_filter(‘wp_get_attachment_image_attributes’,’remove_img_title’); Instead if you want to use <?php the_post_thumbnail( ‘category-thumb’ ); ?> You can pass it an empty title using the second $attr so your title tag will look … Read more

Generate image size, based on the image-orientation

Here is my working solution. The code is documented, so it should be clear what each function does. I pretty much use the wp_generate_attachment_metadata filter to create the needed images after the image has been uploaded. The generated images are listed in the metadata too, like any other intermediate image size. That way you can … Read more

Did I do it right? Deleting images after deleting product. Woocommerce

Looking at @obmerks answer on https://stackoverflow.com/questions/12997698/delete-images-after-post you can simplify it with this: foreach ( $productIds as $productId ) { $child_atts = $wpdb->get_col(“SELECT ID FROM {$wpdb->posts} WHERE post_parent = $productId AND post_type=”attachment””); foreach ( $child_atts as $id ) wp_delete_attachment($id,true); } Note: as per documentation https://codex.wordpress.org/Function_Reference/wp_delete_attachment set the second parameter to true to force delete the attachment, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)