450,
'height' => 200,
'flex-width' => true,
'flex-height' => true,
);
add_theme_support( 'custom-logo', $custom_logo_defaults );
// Add theme support for Custom Header.
$custom_header_defaults = array(
'width' => 1300,
'height' => 500,
'flex-width' => true,
'flex-height' => true,
'default-image' => esc_url( get_template_directory_uri() ) .'/assets/images/ashe_bg.jpg',
'default-text-color' => '111',
);
add_theme_support( 'custom-header', $custom_header_defaults );
// Add theme support for Custom Background.
$custom_background_defaults = array(
'default-color' => '',
);
add_theme_support( 'custom-background', $custom_background_defaults );
// Set the default content width.
$GLOBALS['content_width'] = 960;
// This theme uses wp_nav_menu() in two locations
register_nav_menus( array(
'top' => __( 'Top Menu', 'ashe' ),
'main' => __( 'Main Menu', 'ashe' ),
) );
// Switch default core markup for search form, comment form, and comments to output valid HTML5
add_theme_support( 'html5', array(
'comment-form',
'comment-list',
'gallery',
'caption',
) );
// WooCommerce
add_theme_support( 'woocommerce' );
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
// Theme Activation Notice
global $pagenow;
if ( is_admin() && ('themes.php' == $pagenow) && isset( $_GET['activated'] ) ) {
add_action( 'admin_notices', 'ashe_activation_notice' );
}
// Starter Content
add_theme_support( 'starter-content', array(
// Set up widgets
'widgets' => array(
'sidebar-right' => array(
'text_cta_contact' => [
'text', [
'title' => '',
'text' => ' . '/assets/images/about_widget.png)
Meh syh Schlitz, tempor duis single origin next level ethnic ipsn dsrumdo larame timedos metssole coffee.
' ] ], 'search', 'archives', 'recent-posts', 'categories', ), 'sidebar-alt' => array( 'search', 'calendar', 'text_business_info', ), 'footer-widgets' => array( 'recent-posts', 'recent-comments', 'text_business_info', ), ), // Create core-defined pages 'posts' => array( 'home', 'about', 'contact', 'blog', 'homepage-section' ), // Set up nav menus 'nav_menus' => array( 'main' => array( 'name' => __( 'Main Menu', 'ashe' ), 'items' => array( 'link_home', 'page_about', 'page_blog', 'page_contact', ), ), 'top' => array( 'name' => __( 'Top Menu', 'ashe' ), 'items' => array( 'page_about', 'page_contact', ), ), ), ) ); } add_action( 'after_setup_theme', 'ashe_setup' ); // Notice after Theme Activation function ashe_activation_notice() { echo ''. esc_html__( 'Thank you for choosing Ashe! Now, we higly recommend you to visit our welcome page.', 'ashe' ) .'
'; echo ''; echo ''. wp_trim_words(get_the_excerpt(), $limit) .'
'; } } /* ** Custom Functions */ // Page Layouts function ashe_page_layout() { if ( is_active_sidebar( 'sidebar-left' ) && is_active_sidebar( 'sidebar-right' ) ) { return 'col1-lrsidebar'; } else if ( is_active_sidebar( 'sidebar-left' ) ) { return 'col1-lsidebar'; } else if ( is_active_sidebar( 'sidebar-right' ) ) { return 'col1-rsidebar'; } } // HEX to RGBA Converter function ashe_hex2rgba( $color, $opacity = 1 ) { // remove '#' from string $color = substr( $color, 1 ); // get values from string $hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] ); // convert HEX to RGB $rgb = array_map( 'hexdec', $hex ); // convert HEX to RGBA $output = 'rgba('. implode( ",", $rgb ) .', '. $opacity .')'; return $output; } // Social Media if ( ! function_exists( 'ashe_social_media' ) ) { function ashe_social_media( $social_class='' ) { ?> term_id; // Random if ( $orderby === 'random' ) { $args = array( 'post_type' => 'post', 'post__not_in' => array( $post->ID ), 'orderby' => 'rand', 'posts_per_page' => 3, 'ignore_sticky_posts' => 1, 'meta_query' => array( array( 'key' => '_thumbnail_id', 'compare' => 'EXISTS' ), ) ); // Similar } else { $args = array( 'post_type' => 'post', 'category__in' => array( $first_category ), 'post__not_in' => array( $post->ID ), 'orderby' => 'rand', 'posts_per_page' => 3, 'ignore_sticky_posts' => 1, 'meta_query' => array( array( 'key' => '_thumbnail_id', 'compare' => 'EXISTS' ), ) ); } $similar_posts = new WP_Query( $args ); if ( $similar_posts->have_posts() ) { ?> '; $html .= ''; $html .= ''; $html .= ''; $html .= ''; return $html; } add_filter( 'get_search_form', 'ashe_custom_search_form' ); /* ** Comments Form Section */ if ( ! function_exists( 'ashe_comments' ) ) { function ashe_comments ( $comment, $args, $depth ) { $_GLOBAL['comment'] = $comment; if (get_comment_type() == 'pingback' || get_comment_type() == 'trackback' ) : ?>