How to Remove Height and Width From Inserted Images

When we upload an image with the help of WordPress media uploader and insert it into editor, it comes with height and width attributes. These are normally default attributes, as it assists browser to make appropriate room for the image during layout. But if you want to remove these attributes from image then you can […]

WordPress WP_Query: Get Posts by Meta Values

As you know all the posts have the metadata you can fill in “Custom fields” metabox (it can also be hidden). So, for example, if you want to get a post with meta key show_in_slider and meta value true, you can do it in the following way: Otherwise, if you need to query all posts […]

How to Integrate responsive-nav.js into WordPress Navigation

Responsive Web Design is all the rage these days. Clients are asking for it, web developers are expected to know it, and most importantly, mobile devices are more popular than ever. One big area of a website is website navigation. In my post, I talk all about responsive navigation and how to make it work […]

Taking Control of WordPress 3.8 Admin Bar

What is WordPress Admin Bar? WordPress admin bar was introduced in WordPress 3.1. The purpose of the WordPress Admin Bar was to connect the backend (dashboard) of a WordPress to the Live. It always shows up right below the browser address bar and looks somewhat like below image: The WordPress Admin Bar helps webmasters switch […]

How to Control WordPress Custom Post Types, Capabilities and Roles

As We all knows about Custom Post Types and how to create them, when we create custom post types without Capabilities all users except subscriber roles can publish, read, edit and delete them by default. What if we wanted to create a custom post type that Author could read, edit and publish but Author Staff […]

Notify WordPress users of newly published post

So you have a post section and each time you publish a new custom post you’d like to notify all your users (subscriber). It could be a post, a product, an event or perhaps a tutorial etc. Usually the action hook would be ‘publish_post’ or ‘publish_page’ but those hooks only work for Posts and Pages. […]

How to create a new WordPress array ?

So you have a set of data stored in an array and you want to put aside or create a new array with certain data. There is a powerful function called wp_list_pluck() and wp_list_filter() that can be used for such tasks with any sort of datasets. For example consider the following array: First of all […]

Paginate WordPress posts with a thumbnail image

Its always nice to give your website users the ability to paginate through your posts, and there are a couple of simple inbuilt functions that will allow you to do so from with in the individual posts, by that I mean these functions should be used on the single.php template or single-{post-type}.php template. By using […]

Show Custom Post Types on the Homepage

Custom post types are commonly used in WordPress sites, but they don’t show on the homepage or in the archive pages unless you write code to do that. I’ve put together some code that is smart about detecting your public custom post types and automatically adding them to your homepage and archive pages:

Enable Automatic Updates for WordPress Themes and Plugins

With version 3.7 WordPress introduced automatic updates. By default, these are on for maintenance and security releases only, but the underlying code is smart enough to support updates for themes and plugins. Here’s a simple code that will enable automatic updates for themes: And here’s one for plugins: Please copy above code and past into […]