Skip to content

Instantly share code, notes, and snippets.

@bolorino
bolorino / taxonomy-format.php
Created August 19, 2014 23:53
Get Productions by format. Template: taxonomy-format.php
<?php
/** Theatre WP
* Get Productions by format
**/
// The number of productions to display
$productions_per_page = get_option( 'twp_spectacles_number' );
$term = get_query_var( 'term' );
$term_properties = get_term_by( 'slug', $term, 'format' );
@bolorino
bolorino / archive-spectacle.php
Created August 19, 2014 23:50
Get Paged Productions List. Template: archive-spectacle.php
<?php
/** Theatre WP
* Get a paged list of productions
**/
// The number of productions to display
$spectacles_per_page = get_option( 'twp_spectacles_number' );
$paged = get_query_var('paged') ? intval( get_query_var('paged') ) : 1;
@bolorino
bolorino / single-spectacle.php
Last active August 29, 2015 14:05
Get Production Custom Data. Template: single-spectacle.php
<?php
/** Theatre WP
* Get Production custom metadata
* within the loop
**/
$spectacle_custom = $theatre_wp->get_spectacle_custom( get_the_ID() );
/** Array returns
* $spectacle_custom['synopsis']
* $spectacle_custom['audience']
@bolorino
bolorino / functions.php
Last active April 18, 2021 12:28
Theatre WP theme functions
<?php
// Theatre WP performances pagination
function add_query_vars_filter( $vars ) {
$vars[] = 'upcoming';
return $vars;
}
add_filter( 'query_vars', 'add_query_vars_filter' );
function performances_pagination( $calendar_filter_params ) {