How To Get Featured Image URL, Height And Width In WordPress

If you want to get the URL, width and height of the featured image of a certain post / page you can use the below code.

$featuredImgDetails = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "Full"); 

The above code can be used in the post / page template file and $featuredImgDetails will be an array with

$featuredImgDetails[0] = Image URL
$featuredImgDetails[1] = Image Width
$featuredImgDetails[2] = Image Height

Posted in Wordpress | Tagged | Leave a comment
 

Magento Special Price Still Showing On Product List Page Even After Expiry

An annoying bug if you are using the Special Price feature of a product in Magento. Even after the Special Price To Date is crossed Magento continues to show the reduced price in the product listing / category / catalog page. It however shows the correct price in the product details page.

Solution

In admin panel go to System -> Index Management
Reindex Product Prices

This solves the issue, but as it needs to be done manually is still a problem when lots of promotions are set up. One need to reindex the data manually once every day. One can also try and setup a cron job to do this automatically everyday.

Posted in Magento | Tagged , , | Leave a comment
 

How To Open Two Different Facebook Accounts At The Same Time In Firefox

If you want to open two different accounts in the same site (like Facebook, Gmail etc.) simultaneously using Firefox try the following method –

1. Log into the first Facebook account in Firefox
2. Press Ctrl+Shift+P to open a New Private Window.
Alternatively you can click the File menu on top left and choose “New Private Window” from there.

Voila! You will be allowed to login to a new Facebook account from the private browsing tab.

To do the same from Chrome check out this post.

Posted in Browser | Tagged , , , | 5 Comments
 

How To Open Two Different Facebook Accounts At The Same Time In Chrome

If you want to open two different accounts in the same site (like Facebook, Gmail etc.) simultaneously using Chrome try the following method –

1. Log into the first Facebook account in Chrome
2. Press Ctrl+Shift+N to open a New incognito window.
Alternatively you can click the menu icon on top right and choose “New incognito window” from there.

Voila! You will be allowed to login to a new Facebook account from the incognito tab.

To do the same from Firefox check out this post.

Posted in Browser | Tagged , , | 5 Comments
 

Get Current Child Theme URL In WordPress

While working within the theme files you can easily get the current theme URL by calling –

 
echo get_template_directory_uri();

But if you are working with a child theme it would return the URL of the parent theme. To get the current Child theme URL you can use the following –

 
echo dirname(get_stylesheet_uri())

Happy coding 🙂

Posted in Wordpress | Tagged , , | Leave a comment