Created
          June 4, 2021 14:51 
        
      - 
      
- 
        Save annelyse/58a294d66900bd0f2d805f47fd8628e8 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function categoryListing($taxonomy, $orderby, $order) { | |
| $term_args = array( | |
| 'orderby' => $orderby, | |
| 'order' => $order, | |
| 'hide_empty' => true, | |
| ); | |
| $terms = get_terms($taxonomy,$term_args); | |
| if ($terms) { | |
| foreach($terms as $term) { | |
| echo '<div class="form-group">'; | |
| echo '<input type="checkbox" value="'.$term->term_id .'" id="filter-'. $term->slug .'">'; | |
| echo '<label for="filter-'. $term->slug .'">' . $term->name . '</label>'; | |
| echo '</div>'; | |
| } | |
| } | |
| } | |
| echo categoryListing('lignes', 'menu-order', 'asc'); | |
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment