the_post_thumbnail with lazyload JQ plugin

If you want to apply lazyload to each attachment image, you can just add your hoot to wp_get_attachment_image_attributes filter: add_filter( ‘wp_get_attachment_image_attributes”https://wordpress.stackexchange.com/questions/54986/,”wpse8170_add_lazyload_to_attachment_image’, 10, 2 ); function wpse8170_add_lazyload_to_attachment_image( $attr, $attachment ) { $attr[‘data-original’] = $attr[‘src’]; $attr[‘src’] = “https://wordpress.stackexchange.com/questions/54986/grey.gif”; return $attr; } Or if you can use second approach: $thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), “size” ); // … Read more

Display Category Thumbnail and links in Woo commerce

Have did some customization. This will help you show parent and child category images. You can later customize this code as per your requirements. $taxonomyName = “product_cat”; //This gets top layer terms only. This is done by setting parent to 0. $parent_terms = get_terms($taxonomyName, array(‘parent’ => 0, ‘orderby’ => ‘slug’, ‘hide_empty’ => false)); echo ‘<ul>’; … Read more

Getting Thumbnail Path rather than Image Tag

Thumbnail is essentially attachment so you can approach from that side – lookup ID with get_post_thumbnail_id() and fetch data with wp_get_attachment_image_src(), like this: if (has_post_thumbnail()) { $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(), ‘thumbnail_name’); echo $thumb[0]; // thumbnail url } (source)

Set Featured Image Front Frontend Form

you can do that by running the function set_post_thumbnail( $my_post_id, $thumbnail_id ); remember, you have to process and insert the image into the library first: $uploaddir = wp_upload_dir(); $file = $_FILES[ … whatever you have in your POST data … ]; $uploadfile = $uploaddir[‘path’] . “https://wordpress.stackexchange.com/” . basename( $file ); move_uploaded_file( $file , $uploadfile ); … Read more

Get featured image URL by page id

Did you try anything? Its always helpful to share what you have tried. $url = wp_get_attachment_url( get_post_thumbnail_id($post_id) ); Or if you want to get the image by image size. $src = wp_get_attachment_image_src( get_post_thumbnail_id($post_id), ‘thumbnail_size’ ); $url = $src[0]; http://codex.wordpress.org/Function_Reference/get_post_thumbnail_id http://codex.wordpress.org/Function_Reference/wp_get_attachment_url http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src

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