
Conditions For media query in responsive devices
Being a web developer it is very common for a developer to work on responsive devices and write device specific CSS for it. Now we always have questions about the width we need to implement in order to get the exact css conditions for the mobile and tablet devices.
/* Smartphones (portrait and landscape) ----------- */ @media only screen and (min-device-width : 320px) and (max-device-width : 480px) { /* Styles */ } /* Smartphones (landscape) ----------- */ @media only screen and (min-width : 321px) { /* Styles */ } /* Smartphones (portrait) ----------- */ @media only screen and (max-width : 320px) { /* Styles */ } /* iPads (portrait and landscape) ----------- */ @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) { /* Styles */ } /* iPads (landscape) ----------- */ @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) { /* Styles */ } /* iPads (portrait) ----------- */ @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) { /* Styles */ } /********** iPad 3 **********/ @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) and (-webkit-min-device-pixel-ratio : 2) { /* Styles */ } @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) and (-webkit-min-device-pixel-ratio : 2) { /* Styles */ } /* Desktops and laptops ----------- */ @media only screen and (min-width : 1224px) { /* Styles */ } /* Large screens ----------- */ @media only screen and (min-width : 1824px) { /* Styles */ } /* iPhone 4 ----------- */ @media only screen and (min-device-width : 320px) and (max-device-width : 480px) and (orientation : landscape) and (-webkit-min-device-pixel-ratio : 2) { /* Styles */ } @media only screen and (min-device-width : 320px) and (max-device-width : 480px) and (orientation : portrait) and (-webkit-min-device-pixel-ratio : 2) { /* Styles */ } /* iPhone 5 ----------- */ @media only screen and (min-device-width: 320px) and (max-device-height: 568px) and (orientation : landscape) and (-webkit-device-pixel-ratio: 2){ /* Styles */ } @media only screen and (min-device-width: 320px) and (max-device-height: 568px) and (orientation : portrait) and (-webkit-device-pixel-ratio: 2){ /* Styles */ } /* iPhone 6 ----------- */ @media only screen and (min-device-width: 375px) and (max-device-height: 667px) and (orientation : landscape) and (-webkit-device-pixel-ratio: 2){ /* Styles */ } @media only screen and (min-device-width: 375px) and (max-device-height: 667px) and (orientation : portrait) and (-webkit-device-pixel-ratio: 2){ /* Styles */ } /* iPhone 6+ ----------- */ @media only screen and (min-device-width: 414px) and (max-device-height: 736px) and (orientation : landscape) and (-webkit-device-pixel-ratio: 2){ /* Styles */ } @media only screen and (min-device-width: 414px) and (max-device-height: 736px) and (orientation : portrait) and (-webkit-device-pixel-ratio: 2){ /* Styles */ } /* Samsung Galaxy S3 ----------- */ @media only screen and (min-device-width: 320px) and (max-device-height: 640px) and (orientation : landscape) and (-webkit-device-pixel-ratio: 2){ /* Styles */ } @media only screen and (min-device-width: 320px) and (max-device-height: 640px) and (orientation : portrait) and (-webkit-device-pixel-ratio: 2){ /* Styles */ } /* Samsung Galaxy S4 ----------- */ @media only screen and (min-device-width: 320px) and (max-device-height: 640px) and (orientation : landscape) and (-webkit-device-pixel-ratio: 3){ /* Styles */ } @media only screen and (min-device-width: 320px) and (max-device-height: 640px) and (orientation : portrait) and (-webkit-device-pixel-ratio: 3){ /* Styles */ } /* Samsung Galaxy S5 ----------- */ @media only screen and (min-device-width: 360px) and (max-device-height: 640px) and (orientation : landscape) and (-webkit-device-pixel-ratio: 3){ /* Styles */ } @media only screen and (min-device-width: 360px) and (max-device-height: 640px) and (orientation : portrait) and (-webkit-device-pixel-ratio: 3){ /* Styles */ }
If you have any more condition that can be added to the code Please add it into the comments below.

How to Litter train your Rabbit
Hello all As many of you know I am a pet parent of a wonderful cute Rabbit. Being a pet parent my biggest concern is how to litter train my rabbit. Here are the steps from which we one can Litter train their pet rabbit.
Step 1 :choose a convenient litter location.
Rabbits naturally try to pick a corner when they need to go for litter. You can start putting them in an area with the corner and you can keep their litter box.
Step 2 : choose and prepare a litter box.
Now you need to select a litter box for your rabbit. I would recommend to keep a bigger Litter tray or litter box so that your rabbit can turn-around and have enough space to move and play into it.
Then line the litter box with newspaper or a paper grocery bag, this will help for an easier clean up. Then add a layer of an ultra-absorbent paper litter, Do not use softwoods like pine or cedar shavings or clumping litters. Rabbits do like to nibble on some of the litter and these may cause liver damage or digestive and respiratory problems. Always be sure to monitor them closely after changing to a new bedding or litter.
Step 3 : Introduce your pet to Litter area.
Rabbit have the tendency to smell the poop and then they poop on the same place again. So in order to train your rabbit to use the litter box you need to collect the poops of the rabbit and drop them into the litter tray. When they urinate, wipe it up with a paper towel and then put both the rabbit and the soiled paper towel in the litter box, this will help them as they begin learn where they should go. In order to make toilet of rabbit clean you can use a solution made of 50% of vinegar and 50% of water and apply the spray on the area where the rabbit had urinated.
Once your rabbit is in the litter box, encourage them with words of praise as well as give them some treats . you can do this until you feel the bunny is consistently going in the litter box, this could take time from few days to months.
Step 4 : Give your rabbit more space to roam.
Once you are confident your bunny is going in their litter box, give them a little more space to explore. You can even repeat step three in a few different rooms, and you may want to have a few extra litter box locations for your bunny to go.
If your rabbit has any accidents, be sure to just put them and their droppings or urine in the box and clean and disinfect the area they originally went. Once in the box, praise them again. It is helpful to take them to the box every ten minutes or so and encourage them to go with a treat to hand out if they do.

How to add content below media gallery in woocommerce
One of the ain feature of woocommeerce is the media gallery that is present on the left had side column on the default woocommerce. Now what if we want to add a piece of text below it so we can add content / HTML below it.
In fact, the gallery completely replaces the default content via JQuery, including that particular hook. Adding content is not as easy as it used to be.
Hence , in this blogpost I will be sharing the code snippet that will be used to make this functionality working.
add_action( 'woocommerce_after_single_product_summary' , 'pkbhatt_add_below_prod_gallery', 5 ); function pkbhatt_add_below_prod_gallery() { echo '<div class="woocommerce-product-gallery" style="background: #fdfd5a; padding: 1em 2em">'; echo '<span>THIS IS A TEST. YOU CAN ADD TEXT, IMAGES AND ANY HTML</span>'; echo '</div>'; }

Why A WordPress Site
In this day and age, establishing an online presence is one of the key essentials for having a successful business. By using the internet, your company or small business can reach massive number of people across the globe. And the more potential clients or customers you can reach, the more chances your business has of growing. Therefore, it goes without saying that by launching a solid online platform, your business would acquire opportunities that would otherwise be inaccessible.
To many, creating a website may appear as a complex and nerve-wracking task. Surely, if you want to build a website that runs impeccably, it is inevitable that you would have to put in some effort. However, the process itself doesn’t have to be overly complicated.
This is where WordPress comes in handy. As a user-friendly platform, WordPress is a great base for building any type of website. No matter what requirements you have, WordPress will be able to help you meet them to the fullest. We will present some of the reasons why having a WordPress site could be beneficial for any business.
- It is intuitive and easy to use
Since WordPress is a CMS, or content management system, its users can edit and change their site appearance as they please, with no knowledge of code required whatsoever. WordPress system is integrated in such a way that directs you through all the necessary steps for making a website with complete ease. This means that even if you are a total beginner, there is no danger of getting lost while creating or modifying your website content.
- It has extensive support
For the past 7 years, WordPress has been the most popular CMS platform on the web. In fact, 30% of websites are powered by this software. Moreover, some of the world’s biggest brands use WordPress, like The New Yorker, The Walt Disney Company, MTV News, Microsoft News and Sony Music.
This is not to say that popularity should be the determining factor of why you should use WordPress. Rather, the point we want to make is that thanks to its popularity, WordPress has a huge support community. So many people online are contributing to the improvement of this platform on a daily basis by writing code and answering all sorts of WordPress-related questions. In fact, this community is so vast that just by typing in your question in your search bar, you will most likely get thousands of results with detailed solutions to your problem.
On top of that, a large amount of developers and web designers are completely WordPress savvy. This means that you will easily find professionals who will be able to provide you with thorough website support. Naturally, this will be very beneficial for your business in the long run.
- It is responsive
Among its many useful features, one of the most convenient ones is that WordPress is responsive and completely mobile-friendly. WordPress mobile app allows you to access your WordPress backend. In this way, you will be able to manage and write your website content from your mobile phone.
However, this isn’t the only reason why having a responsive website is important for your business. A large portion of people browses websites through their mobile phones. This means that by having a responsive design, you will attract those who use mobiles and tablets to visit your site as well.
These are all valid reasons to make sure that your website is responsive when it comes to your front end as well. You can take care of this by making sure to install a WordPress theme that has a responsive design. Luckily for you, there are so many responsive and mobile-friendly WordPress themes out there, you will surely be able to find something that will appeal to your specific needs. With responsive design, you will attract more customers and your online business reputation can only soar higher. When you take all these into account, giving your website a responsive design through and through is a no-brainer.
- Plugins
When we say that you can do just about anything with this handy software, we are not exaggerating. But even if by chance you find that there’s something that you can’t do, there are WordPress plugins that you can install that will take care of it.
Building a website of your dreams is a walk in the park with these useful tools, especially since there’s one for practically everything you can think of. Plugins expand the functionality of WordPress and allow users to fully customize their website in a way they prefer. There are a plethora of both free and premium plugins out there that will help you personalize your website down to the smallest detail.
- Scalability
WordPress is a flexible platform capable of powering websites of every size – from small blogs to huge business sites and online stores. In fact, since WordPress is extremely scalable, you won’t have to burden yourself with paying extra money for future upgrades. This scalability is great for growing your business in the long run.
So, with time, your website will probably need some sort of expansion. Once this happens, you will be able to easily upgrade it with various plugins. Likewise, you can equip it with a brand new feature-rich theme that will be up to par with your business requirements. All in all, if you want to expand your business website with WordPress, the sky is the limit!
- Possibility of adding different roles to multiple users
If you have a team of people and you want to assign them to different positions, all with a purpose of maintaining your website in the most efficient manner, WordPress is more than capable of doing so. Namely, there are various WordPress user roles that you can assign to multiple users, all of which have different levels of accessibility.
For instance, the role of Editor has access to managing website content, but holds a lower level of authority compared to Administrator, who is a website creator. Author’s role is that of creating and modifying their own posts, but it has less power than Editor, and so on.
The best thing about this option is that you will be in the driver’s seat the entire time, deciding which role will be assigned to which user and managing your website content with complete ease. As a final result, your online business will be easier to handle as well.
- You have complete ownership
As a platform, WordPress falls under the category of GPL, or general public license. As such, it is an open source not owned by anyone. This means that you are free to use, alter, or upgrade the software in whichever way you deem fit. But that’s not all – you also hold a complete ownership over your website, including your content and any data you have hosted on your site. Speaking of hosting, you don’t have to worry about losing your content if you decide to switch your hosting service provider.
- Security
One of the most common concerns of every site owner is to prevent their website from being hacked, especially since nowadays hacking happens on a regular basis. It’s needless to say that if you want to lead a successful online business, upholding a rock-solid security for your website platform is crucial. This is why it’s your responsibility to arm your website with protection that is strong enough to sustain any hacking attempts. It’s better to be safe than sorry, after all! A convenient thing that comes with having WordPress as your platform is that its status brings you plenty of resources in various areas, one of them being security. Many businesses offer tips, practices and security plugins that will help you fight any unwanted intrusion and ensure that all your website data stays protected.
In addition, WordPress community makes sure to release new security patches regularly. If you keep your WordPress website and all its plugins up to date, you won’t have to stress yourself with security problems.
- Constant upgrades
Another benefit of WordPress’ massive popularity is the fact that it gets upgraded on a daily basis. As WordPress community can be measured by the millions, many of these users and developers come online to share any fixes or improvements they’ve made to the code. In other words, the growth of the platform itself is fully boosted by its community.
- It is SEO-friendly
Good SEO can increase your website traffic by making you visible on search engines. Hence, giving proper optimization to your website is the key to having a prosperous business. After all, what is the point of all that hard work and strategic business planning if nobody can see your website on the first pages of search engines?
Luckily for you, WordPress is a SEO-friendly platform. It comes with plenty of online plugins that will help you with your website ranking. A great tool for this job is a Yoast SEO plugin . With over a million downloads, it is by far the best SEO plugin out there. It helps you make your posts title, meta description and focus keywords SEO-friendly, among other awesome built-in features.
Conclusion
There is practically nothing you can’t do in WordPress. Whether it’s a one-page website, a portfolio, Woocommerce-powered online store, a personal blog, or a massive corporate website – WordPress can truly cover it all. Aside from all these countless possibilities that come with WordPress, it is also SEO-friendly, super responsive and extremely easy to use. Honestly, what else do you need for a successful business site?
These were just some of the many reasons why every business could use a WordPress-powered website. Today, more businesses run on this platform than any other. Join this ever-growing community and find out all the perks of being a WordPress user!

How to replace the product gallery with product video in woocommerce
I am presenting here a code methodology that will be used to replace the product gallery in woocommerce with a custom product video or a video from youtube.
For implementing the same you need to add the following code in your theme’s functions.php file or you can also add the same into your custom plugin.
add_action( 'woocommerce_before_single_product', ‘pkb_replace_vid_with_progal’ ); function pkb_replace_vid_with_progal () { remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 ); remove_action( 'woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20 ); add_action( 'woocommerce_before_single_product_summary', 'pkb_show_product_video', 20 ); } function pkb_show_product_video() { echo '<div class="woocommerce-product-gallery">'; echo '<iframe title="YouTube video player" src="https://www.youtube.com/embed/K4TOrB7at0Y" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe>'; echo '</div>'; }
Hence using the above script in your functions.php file you will be able to replace the woocommerce product thumbnail gallery with custom video.