false );
add_theme_support( 'custom-header', $defaults );
$defaults = array( 'default-color' => 'ffffff' );
add_theme_support( 'custom-background', $defaults );
add_theme_support( 'html5', array( 'search-form', 'navigation-widgets' ) );
add_theme_support( 'woocommerce' );
global $content_width;
if ( !isset( $content_width ) ) $content_width = 1920;
register_nav_menus( array( 'main-menu' => esc_html__( 'Main Menu', 'bands' ), 'footer-menu' => esc_html__( 'Footer Menu', 'bands' ) ) );
}
require_once ( get_template_directory() . '/about.php' );
add_action( 'wp_enqueue_scripts', 'bands_load_scripts' );
function bands_load_scripts() {
wp_enqueue_style( 'bands-style', get_stylesheet_uri() );
wp_enqueue_script( 'jquery' );
wp_register_script( 'bands-videos', get_template_directory_uri() . '/js/videos.js' );
wp_enqueue_script( 'bands-videos' );
wp_add_inline_script( 'bands-videos', 'jQuery(document).ready(function($){$("#wrapper").vids();});' );
}
add_action( 'wp_footer', 'bands_footer_scripts' );
function bands_footer_scripts() {
?>
' . esc_html__( 'Ⓧ', 'bands' ) . '' . wp_kses_post( __( '🎸 Thank you for using Bands!', 'bands' ) ) . '
Use code HALFOFF for 50% off!
' . esc_html__( 'Go Pro', 'bands' ) . ' ' . esc_html__( 'Requests & Support', 'bands' ) . ' ' . esc_html__( 'Review', 'bands' ) . ' ' . esc_html__( 'Donate', 'bands' ) . '
';
}
add_action( 'admin_init', 'bands_notice_dismissed' );
function bands_notice_dismissed() {
$user_id = get_current_user_id();
if ( isset( $_GET['dismiss'] ) )
add_user_meta( $user_id, 'bands_notice_dismissed_5', 'true', true );
}
add_filter( 'document_title_separator', 'bands_document_title_separator' );
function bands_document_title_separator( $sep ) {
$sep = esc_html( '|' );
return $sep;
}
add_filter( 'the_title', 'bands_title' );
function bands_title( $title ) {
if ( $title == '' ) {
return esc_html( '...' );
} else {
return wp_kses_post( $title );
}
}
function bands_schema_type() {
$schema = 'https://schema.org/';
if ( is_single() ) {
$type = "Article";
} elseif ( is_author() ) {
$type = 'ProfilePage';
} elseif ( is_search() ) {
$type = 'SearchResultsPage';
} else {
$type = 'WebPage';
}
echo 'itemscope itemtype="' . esc_url( $schema ) . esc_attr( $type ) . '"';
}
add_filter( 'nav_menu_link_attributes', 'bands_schema_url', 10 );
function bands_schema_url( $atts ) {
$atts['itemprop'] = 'url';
return $atts;
}
if ( !function_exists( 'bands_wp_body_open' ) ) {
function bands_wp_body_open() {
do_action( 'wp_body_open' );
}
}
add_action( 'wp_body_open', 'bands_skip_link', 5 );
function bands_skip_link() {
echo '' . esc_html__( 'Skip to the content', 'bands' ) . '';
}
add_filter( 'the_content_more_link', 'bands_read_more_link' );
function bands_read_more_link() {
if ( !is_admin() ) {
return ' ' . sprintf( __( '...%s', 'bands' ), ' ' . esc_html( get_the_title() ) . '' ) . '';
}
}
add_filter( 'excerpt_more', 'bands_excerpt_read_more_link' );
function bands_excerpt_read_more_link( $more ) {
if ( !is_admin() ) {
global $post;
return ' ' . sprintf( __( '...%s', 'bands' ), ' ' . esc_html( get_the_title() ) . '' ) . '';
}
}
add_filter( 'big_image_size_threshold', '__return_false' );
add_filter( 'intermediate_image_sizes_advanced', 'bands_image_insert_override' );
function bands_image_insert_override( $sizes ) {
unset( $sizes['medium_large'] );
unset( $sizes['1536x1536'] );
unset( $sizes['2048x2048'] );
return $sizes;
}
function bands_reading_time() {
global $post;
$content = get_post_field( 'post_content', $post->ID );
$word_count = str_word_count( strip_tags( $content ) );
$readingtime = ceil( $word_count / 200 );
$totalreadingtime = $readingtime;
return $totalreadingtime;
}
function bands_breadcrumbs() {
ob_start();
global $post;
if ( !is_home() ) {
echo '';
}
$output = ob_get_clean();
return $output;
}
add_action( 'widgets_init', 'bands_widgets_init' );
function bands_widgets_init() {
register_sidebar( array (
'name' => esc_html__( 'Header Widget Area', 'bands' ),
'id' => 'header-widget-area',
'before_widget' => '',
'after_widget' => "",
'before_title' => '',
) );
register_sidebar( array (
'name' => esc_html__( 'Footer Widget Area', 'bands' ),
'id' => 'footer-widget-area',
'before_widget' => '',
'after_widget' => "",
'before_title' => '',
) );
register_sidebar( array (
'name' => esc_html__( 'Sidebar Widget Area', 'bands' ),
'description' => esc_html__( 'Does not display for single posts.', 'bands' ),
'id' => 'primary-widget-area',
'before_widget' => '',
'after_widget' => "",
'before_title' => '',
) );
}
add_action( 'wp_head', 'bands_pingback_header' );
function bands_pingback_header() {
if ( is_singular() && pings_open() ) {
printf( '' . "\n", esc_url( get_bloginfo( 'pingback_url' ) ) );
}
}
add_action( 'comment_form_before', 'bands_enqueue_comment_reply_script' );
function bands_enqueue_comment_reply_script() {
if ( get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); }
}
function bands_custom_pings( $comment ) {
?>
id="li-comment-">