Customize WooCommerce Product Images (Placement and size) [closed]

The file responsible for generating the sidebar cart is mini-cart.php and is located in woocommerce/templates/cart/mini-cart.php What you do is you copy that file and paste it into YOURTHEMEFOLDER/woocommerce/cart/mini-cart.php Open up that file and edit line 40 where it contains <?php echo $_product->get_image(); ?>` Change that to <?php echo $_product->get_image( array( 50, 80 ) ); ?> … Read more

Pages inside a page (with thumbnails)

If I understand, you need to create a template that list all your pages (actors) on one template. If this is the case, you need to create the actor archive template to allow you to: Add a page where you can list all your actors Left the page template intact So, the template that you … Read more

shortcode get thumbnail size

I think your code is very close, try to use wp_get_attachment_image_src() instead: function thumb_medium( $atts, $content = null ) { // return wp_get_attachment_url( get_post_thumbnail_id( $post_id, ‘medium’) ); global $post; $thumb_url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), ‘medium’ )[0]; if ($thumb_url) { return $thumb_url; } } add_shortcode(“get_urlthumb”, “thumb_medium”);

Lazyload post thumbnails

You got everything you need, simply build your own img-element like this: if ( has_post_thumbnail() ) { $class=”lazy attachment-thumbnail-400-300″; //Get thumbnail source $thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), ‘thumbnail-400-300’); $src = $thumb[‘0’]; $placeholder = “//placehold.it/400×300/eee/222/&text=+”; echo ‘<img src=”‘.$placeholder.'” data-original=”‘.$src.'” class=”‘.$class.'” />’; } Besides that, your main performance issue might be generating a new placeholder every time you want … Read more

how to display image from rss

Try using the_post_thumbnail WP function, inside your <li id=”news-single”> markup definition: <li id=”news-single”> <a href=”https://wordpress.stackexchange.com/questions/228220/<?php echo esc_url( $item->get_permalink() ); ?>” target=”_blank” title=”<?php printf( __( ‘Posted %s’, ‘my-text-domain’ ), $item->get_date(‘j F Y | g:i a’) ); ?>”> <?php echo esc_html( $item->get_title() ); ?> </a> <?php // This is the piece of code that you should add: … Read more

Show Post Thumbnail In Custom Post From Other CPT

If you want to get the post thumbnail URL, you can use get_the_post_thumbnail_url(): <?php $image_path=”images/club/” . $opposition->post_name . ‘.jpg’; // relative to the root directory if ( @file_exists( ABSPATH . $image_path ) ) { // Check the unique image first. $thumbnail = home_url( “https://wordpress.stackexchange.com/” . $image_path ); } elseif ( has_post_thumbnail( $opposition ) ) { … Read more

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