250, 'height' => 70, 'flex-height' => true, 'flex-width' => true, 'header-text' => false, 'uploads' => true, ); add_theme_support( 'custom-header', $args ); /* Add support for custom backgrounds */ add_theme_support( 'custom-background' ); /* Add theme settings to the customizer. */ require_once( trailingslashit( get_template_directory() ) . 'admin/customize.php' ); /* Default footer settings */ add_filter( "{$prefix}_default_theme_settings", 'ascetica_default_footer_settings' ); /* Widgets */ add_action( 'widgets_init', 'ascetica_register_widgets' ); /* Add support for Post Formats */ add_theme_support( 'post-formats', array( 'gallery' ) ); /* Remove the "Theme Settings" submenu. */ add_action( 'admin_menu', 'ascetica_remove_theme_settings_submenu', 11 ); } /** * Disables sidebars if viewing a two-column - wide page, or a gallery post. * */ function ascetica_disable_sidebars( $sidebars_widgets ) { global $wp_query; if ( is_page_template( 'page-template-wide.php' ) || ( is_singular() && has_post_format( 'gallery', get_queried_object_id() ) ) ) { $sidebars_widgets['secondary'] = false; } return $sidebars_widgets; } /** * Overwrites the default widths for embeds. This is especially useful for making sure videos properly * expand the full width on video pages. This function overwrites what the $content_width variable handles * with context-based widths. * */ function ascetica_embed_defaults( $args ) { $args['width'] = 470; if ( is_page_template( 'page-template-wide.php' ) ) $args['width'] = 660; return $args; } /** * Excerpt ending * */ function ascetica_excerpt_more( $more ) { return '...'; } /** * Custom excerpt lengths * */ function ascetica_excerpt_length( $length ) { return 35; } /** * Enqueue scripts (and related stylesheets) * */ function ascetica_scripts() { if ( !is_admin() ) { /* Enqueue Scripts */ wp_enqueue_script( 'ascetica_fancybox', get_template_directory_uri() . '/js/fancybox/jquery.fancybox-1.3.4.pack.js', array( 'jquery' ), '1.0', true ); wp_enqueue_script( 'ascetica_fitvids', get_template_directory_uri() . '/js/fitvids/jquery.fitvids.js', array( 'jquery' ), '1.0', true ); wp_enqueue_script( 'ascetica_flexslider', get_template_directory_uri() . '/js/flex-slider/jquery.flexslider-min.js', array( 'jquery' ), '1.0', true ); wp_enqueue_script( 'ascetica_navigation', get_template_directory_uri() . '/js/navigation.js', array( 'jquery' ), '20130223', true ); wp_enqueue_script( 'ascetica_footer-scripts', get_template_directory_uri() . '/js/footer-scripts.js', array( 'jquery', 'ascetica_fitvids', 'ascetica_fancybox', 'ascetica_flexslider' ), '1.0', true ); /* Enqueue Styles */ wp_enqueue_style( 'ascetica_fancybox-stylesheet', get_template_directory_uri() . '/js/fancybox/jquery.fancybox-1.3.4.css', false, 1.0, 'screen' ); wp_enqueue_style( 'ascetica_flexslider-stylesheet', get_template_directory_uri() . '/js/flex-slider/flexslider.css', false, 1.0, 'screen' ); } } /** * Pagination args * */ function ascetica_pagination_args( $args ) { $args['prev_text'] = __( '« Previous', 'ascetica' ); $args['next_text'] = __( 'Next »', 'ascetica' ); return $args; } /** * Image sizes * */ function ascetica_image_sizes() { add_image_size( 'singular-gallery-thumbnail', 400, 230, true ); add_image_size( 'singular-thumbnail', 660, 330, true ); } /** * Unregister Hybrid widgets * */ function ascetica_unregister_widgets() { unregister_widget( 'Hybrid_Widget_Search' ); register_widget( 'WP_Widget_Search' ); } /** * Custom comments arguments * */ function ascetica_comments_args( $args ) { $args['avatar_size'] = 40; return $args; } /** * Custom comment form arguments * */ function ascetica_commentform_args( $args ) { global $user_identity; /* Get the current commenter. */ $commenter = wp_get_current_commenter(); /* Create the required and element class. */ $req = ( ( get_option( 'require_name_email' ) ) ? ' ' . __( '*', 'ascetica' ) . ' ' : '' ); $input_class = ( ( get_option( 'require_name_email' ) ) ? ' req' : '' ); $fields = array( 'author' => '

', 'email' => '

', 'url' => '

' ); $args = array( 'fields' => apply_filters( 'comment_form_default_fields', $fields ), 'comment_field' => '

', 'must_log_in' => '

' . sprintf( __( 'You must be logged in to post a comment.', 'ascetica' ), wp_login_url( get_permalink() ) ) . '

', 'logged_in_as' => '

' . sprintf( __( 'Logged in as %2$s.', 'ascetica' ), admin_url( 'profile.php' ), esc_attr( $user_identity ) ) . ' ' . __( 'Log out »', 'ascetica' ) . '

', 'comment_notes_before' => '', 'comment_notes_after' => '', 'id_form' => 'commentform', 'id_submit' => 'submit', 'title_reply' => __( 'Leave a Reply', 'ascetica' ), 'title_reply_to' => __( 'Leave a Reply to %s', 'ascetica' ), 'cancel_reply_link' => __( 'Click here to cancel reply.', 'ascetica' ), 'label_submit' => __( 'Post Comment', 'ascetica' ), ); return $args; } /** * Default footer settings * */ function ascetica_default_footer_settings( $settings ) { $settings['footer_insert'] = '' . "\n\n" . '

' . __( 'Powered by [wp-link] and [theme-link]', 'ascetica' ) . '

'; return $settings; } /** * Widgets * */ function ascetica_register_widgets() { /* Include widget classes */ require_once( get_template_directory() . '/includes/widget-thumbnails.php' ); /* Register widgets */ register_widget( 'Ascetica_Thumbnails_Widget' ); } /** * Ascetica site title. * */ function ascetica_site_title() { $tag = ( is_front_page() ) ? 'h1' : 'div'; if ( get_header_image() ) { echo '<' . $tag . ' id="site-title">' . "\n"; echo '' . "\n"; echo '' . "\n"; echo '' . "\n"; echo '' . "\n"; } elseif ( hybrid_get_setting( 'ascetica_logo_url' ) ) { // check for legacy setting echo '<' . $tag . ' id="site-title">' . "\n"; echo '' . "\n"; echo '' . "\n"; echo '' . "\n"; echo '' . "\n"; } else { hybrid_site_title(); } } /** * Remove the "Theme Settings" submenu. * */ function ascetica_remove_theme_settings_submenu() { /* Remove the Theme Settings settings page. */ remove_submenu_page( 'themes.php', 'theme-settings' ); } ?>