Tuesday 10 October 2017

WordPress Customizer Custom Controls: Categories dropdown


Are you building a WordPress theme? Perhaps you are extending a theme by working on a child theme? Or maybe, you are building a WordPress plugin that has something to do with the site’s presentation. Chances are, you need to add options into the WordPress Customizer. Options in the customizer are added as controls. A “control” in the case of the WordPress customizer, can be loosely defined as “a reusable UI component” that can either be simple (e.g. a title and an input box) or more complex (e.g. a title, a group of checkboxes and a dropdown). Fortunately, WordPress itself provides some customizer controls that can be used without much effort. Unfortunately, the selection of controls it provides is quite limited, leaving a lot to be desired.
One big omission (in my opinion) is the lack of a categories dropdown selection control. You know, the one where all categories are listed hierarchically (perhaps even with post counts) and you can select just one. Most probably you’ve seen this in Settings → Writing, where you can select the default category your posts will be assigned to.
Now, WordPress already provides a ‘select‘ control which
Source: https://managewp.org/articles/16277/wordpress-customizer-custom-controls-categories-dropdown




source https://williechiu40.wordpress.com/2017/10/10/wordpress-customizer-custom-controls-categories-dropdown/

No comments:

Post a Comment