'#373737',
'default-image' => get_template_directory_uri() . '/img/bg-main.png',
) );
/**
* Enable support for automatic feed links.
*/
add_theme_support( 'automatic-feed-links' );
/**
* Enable support for Post Formats
*/
add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) );
/**
* Register our two theme menus.
*/
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'eventbrite-venue' ),
'secondary' => __( 'Secondary Menu', 'eventbrite-venue' ),
) );
}
add_action( 'after_setup_theme', 'eventbrite_multi_setup' );
/**
* Global theme script enqueing
*
*/
if ( ! function_exists( 'eventbrite_multi_enqueue_scripts' ) ) {
function eventbrite_multi_enqueue_scripts() {
// Main theme stylesheet
wp_enqueue_style( 'eventbrite-venue-style', get_stylesheet_uri() );
// Google Fonts
wp_enqueue_style( 'eventbrite-venue-cutive' );
wp_enqueue_style( 'eventbrite-venue-raleway' );
// Main theme script
wp_enqueue_script( 'eventbrite-venue-main', get_template_directory_uri() . '/js/script.js', array( 'jquery' ), '20130915', true );
// Bootstrap scripts
wp_enqueue_script( 'eventbrite-venue-carousel', get_template_directory_uri() . '/js/bootstrap/bootstrap-carousel.js', array(), '20130915', true );
wp_enqueue_script( 'eventbrite-venue-collapse', get_template_directory_uri() . '/js/bootstrap/bootstrap-collapse.js', array(), '20130915', true );
wp_enqueue_script( 'eventbrite-venue-tooltip', get_template_directory_uri() . '/js/bootstrap/bootstrap-tooltip.js', array(), '20130915', true );
wp_enqueue_script( 'eventbrite-venue-popover', get_template_directory_uri() . '/js/bootstrap/bootstrap-popover.js', array(), '20130915', true );
// Modernizr
wp_enqueue_script( 'eventbrite-venue-modernizr', get_template_directory_uri() . '/js/libs/modernizr.js', array(), '20140304', false );
// Inline reply script for comments
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );
}
add_action( 'wp_enqueue_scripts', 'eventbrite_multi_enqueue_scripts' );
}
/**
* Register Google Fonts
*/
function eventbrite_multi_google_fonts() {
/* translators: If there are characters in your language that are not supported
by Raleway, translate this to 'off'. Do not translate into your own language. */
if ( 'off' !== _x( 'on', 'Raleway font: on or off', 'eventbrite-venue' ) ) {
wp_register_style( 'eventbrite-venue-raleway', "https://fonts.googleapis.com/css?family=Raleway:400,800" );
}
/* translators: If there are characters in your language that are not supported
by Cutive, translate this to 'off'. Do not translate into your own language. */
if ( 'off' !== _x( 'on', 'Cutive font: on or off', 'eventbrite-venue' ) ) {
wp_register_style( 'eventbrite-venue-cutive', "https://fonts.googleapis.com/css?family=Cutive" );
}
}
add_action( 'init', 'eventbrite_multi_google_fonts' );
//sidebars
function eventbrite_multi_register_sidebars() {
register_sidebar( array(
'name' => __( 'Primary Sidebar', 'eventbrite-venue' ),
'id' => 'sidebar-1',
'description' => __( 'Appears on posts and pages in the sidebar.', 'eventbrite-venue' ),
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'eventbrite_multi_register_sidebars' );
/**
* Custom comment callback template
*
* @param type $comment
* @param type $args
* @param type $depth
*/
function eventbrite_multi_comment_template( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
?>
id="div-comment-">
%2$s';
$update_time = '';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) )
$update_time = '';
$time_string = sprintf( $time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() )
);
printf( __( 'Posted on %3$s', 'eventbrite-venue' ),
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
$time_string
);
if ( !empty($update_time) ) {
$update_time = sprintf( $update_time,
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() )
);
printf( __( ' Updated on %3$s', 'eventbrite-venue' ),
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
$update_time
);
}
}
/**
* Get the next attached image
*/
function eventbrite_multi_the_attached_image() {
$next_id = null;
$post = get_post();
$attachment_size = apply_filters( 'eventbrite_multi_attachment_size', array( 1200, 1200 ) );
$next_attachment_url = wp_get_attachment_url();
if ( $post->post_parent ) {
/**
* Grab the IDs of all the image attachments in a gallery so we can get the
* URL of the next adjacent image in a gallery, or the first image (if
* we're looking at the last image in a gallery), or, in a gallery of one,
* just the link to that image file.
*/
$attachment_ids = get_posts( array(
'post_parent' => $post->post_parent,
'fields' => 'ids',
'numberposts' => 999,
'post_status' => 'inherit',
'post_type' => 'attachment',
'post_mime_type' => 'image',
'order' => 'ASC',
'orderby' => 'menu_order ID'
) );
// If there is more than 1 attachment in a gallery...
if ( is_countable( $attachment_ids ) && 1 < count( $attachment_ids ) ) {
foreach ( $attachment_ids as $idx => $attachment_id ) {
if ( $attachment_id == $post->ID ) {
$next_id = $attachment_ids[ ( $idx + 1 ) % count( $attachment_ids ) ];
break;
}
}
// get the URL of the next image attachment...
if ( $next_id )
$next_attachment_url = get_attachment_link( $next_id );
// or get the URL of the first image attachment.
else
$next_attachment_url = get_attachment_link( array_shift( $attachment_ids ) );
}
}
printf( '%3$s',
esc_url( $next_attachment_url ),
the_title_attribute( array( 'echo' => false ) ),
wp_get_attachment_image( $post->ID, $attachment_size )
);
}
/**
* Modify caption HTML
*/
function eventbrite_multi_caption_shortcode( $val, $attr, $content = null ) {
$width = null;
$id = null;
$align = null;
$sc_atts = shortcode_atts( array(
'id' => '',
'align' => 'aligncenter',
'width' => '',
'caption' => ''
), $attr );
extract( $sc_atts );
if ( 1 > (int) $width || empty( $caption ) )
return $val;
$capid = '';
if ( $id ) {
$id = esc_attr( $id );
$capid = 'id="figcaption_'. $id . '" ';
$id = 'id="' . $id . '" aria-labelledby="figcaption_' . $id . '" ';
}
return '';
}
add_filter( 'img_caption_shortcode', 'eventbrite_multi_caption_shortcode', 10, 3 );
/**
* Add eventbrite info to title
* @param string $title
* @return string
*/
function eventbrite_multi_wp_title( $title ) {
if ( is_feed() )
return $title;
// Add the site name.
$title .= get_bloginfo( 'name' );
return $title;
}
add_filter( 'wp_title', 'eventbrite_multi_wp_title', 10, 2 );
/**
* Displays navigation to next/previous set of posts when applicable.
*/
function eventbrite_multi_paging_nav( $args = array() ) {
$paged = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1;
$pagenum_link = html_entity_decode( get_pagenum_link() );
$query_args = array();
$url_parts = explode( '?', $pagenum_link );
if ( isset( $url_parts[1] ) ) {
wp_parse_str( $url_parts[1], $query_args );
}
$pagenum_link = remove_query_arg( array_keys( $query_args ), $pagenum_link );
$pagenum_link = trailingslashit( $pagenum_link ) . '%_%';
$format = $GLOBALS['wp_rewrite']->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : '';
$format .= $GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit( 'page/%#%', 'paged' ) : '?paged=%#%';
$default = array(
'base' => $pagenum_link,
'format' => $format,
'total' => $GLOBALS['wp_query']->max_num_pages,
'current' => $paged,
'mid_size' => 1,
'add_args' => http_build_query( $query_args ),
'prev_text' => __( '← Previous', 'eventbrite-venue' ),
'next_text' => __( 'Next →', 'eventbrite-venue' ),
'type' => 'list'
);
$paginate_links_args = wp_parse_args( (array) $args, $default );
$paginate_links_args = array_intersect_key( $paginate_links_args, $default );
// Don't print empty markup if there's only one page.
if ( $paginate_links_args['total'] < 2 )
return;
$links = paginate_links( $paginate_links_args );
if ( $links ) :
?>
start->local );
$month = $start_date->format( 'M' );
$date = $start_date->format( 'j' );
$day = $start_date->format( 'D' );
/*
* Translators: %1$s = month, %2$s = date, %3$s = day
*/
$html = sprintf( __( '%1$s %2$s %3$s', 'eventbrite-venue' ),
$month,
'' . $date . '',
$day
);
return $html;
}
/**
* Set the content width global.
*/
if ( ! isset( $content_width ) ) {
$content_width = 705;
}
/**
* Adds support for a custom header image.
*/
require get_template_directory() . '/inc/custom-header.php';
/**
* Load Jetpack compatibility file.
*/
require get_template_directory() . '/inc/jetpack.php';
/**
* Load our Eventbrite theme options.
*/
require get_template_directory() . '/inc/theme-options.php';
/**
* Load our Eventbrite-specific functions and hooks.
*/
require get_template_directory() . '/inc/eventbrite.php';
/**
* Load Eventbrite widgets.
*/
require get_template_directory() . '/inc/widgets.php';