How to Display Categories in a Drop Down Menu in WordPress

How to Display Categories in a Drop Down Menu in WordPress

Some blogs is said to have lots of categories where they cant display their sidebar. Or some blogger dont want to take up lots of space for displaying categories. This option helps to allow them to select menu, drop menu for categories. See WordPress Codex for details.

$select = wp_dropdown_categories(‘show_option_none=Select Category&show_count=1&orderby=name&echo=0&selected=6’);
$select = preg_replace(“#<select([^>]*)>#”, “<select$1 onchange=’return this.form.submit()’>”, $select);
echo $select;
?>
Looking for the best CMS website then contact us at 044 4851 2757

Leave a Reply

Your email address will not be published. Required fields are marked *