How to set global variable in functions.php

You can turn your snippet into a function that returns the post thumbnail URL of a post: function wpse81577_get_small_thumb_url( $post_id ) { $thumbSmall = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), ‘small’ ); return $thumbSmall[‘0’]; } Usage, supplying the ID of a post: <?php echo wpse81577_get_small_thumb_url( 59 ); ?>

Make thumbnails in woocommerce replace the main image instead of opening fancybox

I have just achieved the effect by my own. I will post it here in case others find this thread: jQuery(document).on(‘click’,’.thumbnails .zoom’, function(){ var photo_fullsize = jQuery(this).find(‘img’).attr(‘src’).replace(‘-100×132’,”); jQuery(‘.woocommerce-main-image img’).attr(‘src’, photo_fullsize); return false; }); .replace(‘-100×132’) eliminates the size from url of the image to return the full image and not the thumbnail. Replace it with your … Read more

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