Complete Guide to WordPress Admin Notices

Dig WP has just published a post “Complete Guide to WordPress Admin Notices” and I am sure it’s helpful for you guys. There are 4 types of admin notices in WordPress: Success – displayed when something good happens, like settings updated successfully Error – displayed when an error or something bad happens Warning – displayed … Continue reading “Complete Guide to WordPress Admin Notices”

“Update Notice” for Self-hosted Themes

You’ll get a “update notice” for each theme hosted in theme directory if there is a new version. For some reasons, your themes are not hosted in but what if you still want to add the notice to your users? I’ll show you how. Before going to the dirty part, we’ll first need … Continue reading ““Update Notice” for Self-hosted Themes”

Frontend Image Uploader in WordPress

WordPress has provided us many functions to upload images, like media_handle_upload(), media_handle_sideload(), wp_handle_upload(), wp_import_handle_upload(),wp_handle_sideload(), media_sideload_image(). I have another post showing how to upload an image with AJAX. Check it here. You are still recommended to read this post before going to the ajax one. If you want to add an image upload form in the frontend, then … Continue reading “Frontend Image Uploader in WordPress”

Multiple Checkbox Control for WP Customizer

Since theme review team asked all theme authors to implement the Customizer for their theme options, how to leverage the core customizer controls is important for any theme authors. Core provides several built-in control types: text checkbox (it’s single checkbox) textarea radio (pass a keyed array of values => labels to the choices argument) … Continue reading “Multiple Checkbox Control for WP Customizer”

Clean Up wp_head

WordPress will by default output quite a lot of unnecessary stuff on the document header with the wp_head() function. Let’s start removing them. Put following codes to your functions.php, a recommended way is to hook to the after_setup_theme action. View the code on Gist. Comment line by line. L1: The RSD(Really Simple Discovery) is an … Continue reading “Clean Up wp_head”

How to fix “pagination not working” in custom query

By default, in any given context, WordPress uses the main query to determine pagination. The main query object is stored in the $wp_query global, which is also used to output the main query loop. Pagination template tags, including previous_posts_link(), next_posts_link(), posts_nav_link(), and paginate_links(), base their output on the main query object, $wp_query. That main query … Continue reading “How to fix “pagination not working” in custom query”

Get the input content of TinyMCE editor

I am recently working on a project that enables users to submit content from frontend. Since I am using wp_editor() to display the editor, I find it a little bit of confused how to correctly save the input content. StackExchange user Sam posted a solution in a thread. It just works perfect. WordPress keeps track … Continue reading “Get the input content of TinyMCE editor”

Use WP Tab Widget Pro to Transform your website

While there are so many beautiful themes out there, sidebars have sort of been ignored by many top-notch developers. However, sidebars are very important for increasing page views by showing engaging content on your website and they make an excellent use of the valuable real-estate of your website. An engaging and beautiful sidebar may mean … Continue reading “Use WP Tab Widget Pro to Transform your website”