php - Add a class to my select element -


i want add class of "btn" select element. select element like

<select class="btn"> 

add class in code:

<form id="category-select" class="category-select" action="<?php echo esc_url( home_url( '/' ) ); ?>" method="get">          <?php         $args = array(             'show_option_none' => __( 'select category' ),             'show_count'       => 1,             'orderby'          => 'name',             'echo'             => 0,         );         ?>          <?php $select  = wp_dropdown_categories( $args ); ?>         <?php $replace = "<select$1 onchange='return this.form.submit()'>"; ?>         <?php $select  = preg_replace( '#<select([^>]*)>#', $replace, $select ); ?>          <?php echo $select; ?>          <noscript>             <input type="submit" value="view" />         </noscript>      </form> 

the documentation shows option of 'class' in args provide

$args = array(         'show_option_none' => __( 'select category' ),         'show_count'       => 1,         'orderby'          => 'name',         'echo'             => 0,         'class'            => 'btn'     ); 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -