Skip to content

Instantly share code, notes, and snippets.

View tannermann's full-sized avatar

Tanner Mann tannermann

  • Madison, WI, USA
View GitHub Profile
@willybahuaud
willybahuaud / exemple.php
Last active August 10, 2020 13:49
wp_dropdown_category multiple
<?php
wp_dropdown_categories( array(
'taxonomy' => 'category',
'multiple' => true,
'walker' => new Willy_Walker_CategoryDropdown(),
'selected' => array( 10, 12 ), // selected terms…
'hide_empty' => false,
) );
@wpmark
wpmark / wp-query-orderby-muliple-meta-keys.php
Created November 18, 2015 12:48
WP_Query Ordered By Multiple Meta Keys
<?php
/* build a new wp_query */
$classes = new WP_Query(
array(
'post_type' => 'wpmark_class_time', // post type to query
'posts_per_page' => -1, // get all the posts not limited
'meta_query' => array(
'relation' => 'AND',
'day' => array( // give the first meta key array an array key
'key' => '_wpmark_day',
@jo-snips
jo-snips / events-conditional-wrappers.php
Last active December 21, 2023 12:27
The Events Calendar: Basic Conditional Wrappers
<?php
/*-----------------------------------------------------------------------------------*/
/* Conditional Logic to Detect Various Event Related Views/Pages
/*-----------------------------------------------------------------------------------*/
if( tribe_is_month() && !is_tax() ) { // Month View Page
echo 'were on the month view page';
} elseif( tribe_is_month() && is_tax() ) { // Month View Category Page