How To Exclude Posts and Pages in WordPress Search

Sometimes we don’t want to display every page and post in search results. Today I like to explain you how to add filter to the search. For this I have added a filter to the search query of WordPress and exclude posts or pages as per my requirement of the search result. We can exclude […]

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 […]

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 […]

WordPress 3.8 arrives with redesigned dashboard, new theme and widget screens, vector-based icons, and many more

WordPress.org announced the debut of WordPress 3.8, which introduces a modern new design that the company calls its “most beautiful update yet.” You can download the new release now from WordPress.org/Download (it’s 6.10MB). Dubbed “Parker” in honor of American jazz saxophonist and composer Charlie Parker, WordPress 3.8 brings a new look to the entire admin […]

Add a Custom Post Type Submenu To Another Post Type Menu

Custom Post Types are the most powerful features of WordPress, specially if you’re in the business of creating custom solutions for clients beyond normal bloging functionality. Introducing a new menu in the WordPress dashboard is really easy when using the custom post type API; however, what about the case when you have a custom post […]

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 […]