Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--E importante criar uma categoria pai para buscar as
- categorias desejadas nessa parte do codigo add o ID da categoria pai'child_of' => 56
- -->
- <form role="search" method="get" id="searchform" class="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>">
- <div> <span>LOJA</span><br />
- <input type="text" value="<?php echo get_search_query(); ?>" name="s" id="s" />
- <br />
- <span >CATEGORIA</span> <br />
- <select>
- <option value="-1">Selecione a categoria</option>
- <?php
- $categories = get_categories( array( 'child_of' => 56 ));
- foreach ( $categories as $category ) {
- printf( '<option value="%1$s">%2$s (%3$s)</option>',
- esc_attr( '' . $category->term_id ),
- esc_html( $category->cat_name ),
- esc_html( $category->category_count )
- );
- }
- ?>
- </select>
- <br />
- <input type="submit" id="searchsubmit" value="<?php echo esc_attr_x( 'Search', 'submit button' ); ?>" />
- </div>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement