1366, 'height' => 600, 'flex-height' => false, 'flex-width' => false, 'uploads' => true, 'random-default' => false, 'header-text' => true, 'default-text-color' => '', 'wp-head-callback' => '', 'admin-head-callback' => '', 'admin-preview-callback' => '', ); add_theme_support('custom-header', $defaults_custom_header); /* Add support for title tag. */ add_theme_support('title-tag'); /* Add support for gallery. */ add_theme_support('html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', )); /* Add support for post thumbnails. */ add_theme_support('post-thumbnails'); /* Register nav menus. */ register_nav_menus(array( 'primary' => esc_html__('Primary (Main Menu)', 'asycom') )); $custom_logo_defaults = array( 'height' => 256, 'width' => 65, 'flex-height' => true, 'flex-width' => true, 'header-text' => array('site-title', 'site-description'), ); add_theme_support('custom-logo', $custom_logo_defaults); } add_action('after_setup_theme', 'asycom_theme_setup'); } /* ------------------------------------------- * 3 - GET POST META * ------------------------------------------- */ if (!function_exists('asycom_post_meta')) { function asycom_post_meta($args = null) { if (get_post_type() === 'post') { if (!empty($args) && is_array($args) && $args["cats"] != false) { $categories_list = get_the_category_list(' '); if ( ! empty( $categories_list ) ) { printf('

%1$s

', $categories_list ); } } if (!empty($args) && is_array($args) && $args["tags"] != false) { if (get_the_tag_list()) { echo get_the_tag_list(''); } } echo '

' . esc_html__('By', 'asycom'); printf(' ', esc_url(get_author_posts_url(get_the_author_meta('ID'))), get_the_author()); esc_html_e('on', 'asycom'); echo ' ' . esc_html(get_the_date()) . '

'; } } } /* ------------------------------------------- * 4 - PAGINATION * ------------------------------------------- */ if (!function_exists('asycom_pagination')) { function asycom_pagination() { $args = array( 'prev_next' => false, 'type' => 'array' ); $pagination = paginate_links($args); if (is_array($pagination)) { echo ''; } } } /* ------------------------------------------- * 5 - REGISTER WIDGET AREAS * ------------------------------------------- */ if (!function_exists('asycom_widget_init')) { function asycom_widget_init() { if (function_exists('register_sidebar')) { register_sidebar(array( 'name' => esc_html__('Main Widget Area', 'asycom'), 'id' => 'main-sidebar', 'description' => esc_html__('Appears in the blog pages', 'asycom'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => esc_html__('Footer 1', 'asycom'), 'id' => 'footer-1', 'description' => esc_html__('Add widgets here to appear in your footer area 1.', 'asycom'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => esc_html__('Footer 2', 'asycom'), 'id' => 'footer-2', 'description' => esc_html__('Add widgets here to appear in your footer area 2.', 'asycom'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => esc_html__('Footer 3', 'asycom'), 'id' => 'footer-3', 'description' => esc_html__('Add widgets here to appear in your footer area 3.', 'asycom'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => esc_html__('Footer 4', 'asycom'), 'id' => 'footer-4', 'description' => esc_html__('Add widgets here to appear in your footer area 4.', 'asycom'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } } add_action('widgets_init', 'asycom_widget_init'); } /* ------------------------------------------- * 6 - REGISTER Scripts * ------------------------------------------- */ if (!function_exists('asycom_scripts')) { function asycom_scripts() { /* Register scripts */ wp_register_script('bootstrap-js', get_template_directory_uri() . '/assets/js' . '/bootstrap.js', array('jquery'), false, false, TRUE); wp_register_script('slim-menu', get_template_directory_uri() . '/assets/js' . '/jquery.slimmenu.min.js', array('jquery'), false, false, true); wp_register_script('in-view', get_template_directory_uri() . '/assets/js' . '/in-view.min.js', array('jquery'), false, false, true); wp_register_script('percircle', get_template_directory_uri() . '/assets/js' . '/percircle.min.js', array('jquery'), false, false, true); wp_register_script('main-js', get_template_directory_uri() . '/assets/js' . '/main.js', false, false, true); $asycom_custom_css = asycom_inline_css(); wp_add_inline_style( 'asycom-inline-style', $asycom_custom_css ); /* Load scripts */ wp_enqueue_script('bootstrap-js'); wp_enqueue_script('slim-menu'); wp_enqueue_script('jquery-masonry'); wp_enqueue_script('in-view'); wp_enqueue_script('jquery-easing'); wp_enqueue_script('percircle'); wp_enqueue_script('main-js'); if (is_singular()) { wp_enqueue_script("comment-reply"); } /* Load stylesheets */ wp_enqueue_style('bootstrap-css', ASYCOM_THEMEROOT . '/assets/css/bootstrap.css'); wp_enqueue_style('slim-menu-css', ASYCOM_THEMEROOT . '/assets/css/slimmenu.min.css'); wp_enqueue_style('animate-css', ASYCOM_THEMEROOT . '/assets/css/animate.css'); wp_enqueue_style('percircle-css', ASYCOM_THEMEROOT . '/assets/css/percircle.min.css'); wp_enqueue_style('main-css', ASYCOM_THEMEROOT . '/assets/css/main.css'); wp_enqueue_style('google-font', 'https://fonts.googleapis.com/css?family=Raleway:100,200,300,400,700'); } add_action('wp_enqueue_scripts', 'asycom_scripts'); } /* ------------------------------------------- * 7 - COMMENTS NAV * ------------------------------------------- */ if (!function_exists('asycom_comment_nav')) { function asycom_comment_nav() { // Are there comments to navigate through? if (get_comment_pages_count() > 1 && get_option('page_comments')) : ?> $current_post_id, 'orderby' => 'comment_date_gmt', 'order' => get_option('comment_order', 'asc'), /* Respect comment order from Settings ยป Discussion. */ 'status' => 'approve', 'number' => 20, /* Only retrieve the last 20 comments, as the end goal is just 6 unique authors */ ) ); $authors = array(); foreach ($comments as $comment) { $authors[] = ( (int) $comment->user_id > 0 ) ? (int) $comment->user_id : $comment->comment_author_email; } $authors = array_unique($authors); $discussion = (object) array( 'authors' => array_slice($authors, 0, 6), /* Six unique authors commenting on the post. */ 'responses' => get_comments_number($current_post_id), /* Number of responses. */ ); return $discussion; } /* ----------------------------------------------------------------------------------- * 13 - NAVIGATION WALKER * ----------------------------------------------------------------------------------- */ function asycom_custom_walker() { $args = array( 'container_class' => 'main-nav-wrapper', 'menu_class' => ' ', 'container_id' => 'main-menu-1', 'theme_location' => 'primary', 'container' => 'ul', 'menu_class' => 'slimmenu', 'menu_id' => '' ); if (has_nav_menu('primary')) { return false; } if (current_user_can('edit_theme_options')) { $ac_out = null; if ($args['container']) { $ac_out = '<' . $args['container']; if ($args['container_id']) { $ac_out .= ' id="' . $args['container_id'] . '"'; } if ($args['container_class']) { $ac_out .= ' class="' . $args['container_class'] . '"'; } $ac_out .= '>'; } $ac_out .= 'Add a menu'; $ac_out .= ''; if ($args['container']) { $ac_out .= ''; } $allowed_html = array( 'a' => array( 'href' => array(), ), 'div' => array( 'id' => array(), 'class' => array(), ), 'ul' => array( 'class' => array(), ), 'li' => array(), ); echo wp_kses($ac_out, $allowed_html); } } function asycom_inline_css() { $asycom_header_nav_normal_color = get_theme_mod( 'asycom_header_nav_color', '#fff' ); $asycom_header_nav_hover_color = get_theme_mod('asycom_header_nav_hover_color', '#e91e63'); $asycom_social_bgcolor = get_theme_mod('asycom_social_bg_color', '#2d2a2c'); $asycom_global_bloglist_thumbnail = get_theme_mod('asycom_global_bloglist_thumbnail', 'cover'); echo ''; } function asycom_header_bg() { $background_url = get_header_image(); if ( is_null( $background_url ) ) { return; } if ( ! filter_var( $background_url, FILTER_VALIDATE_URL ) ) { return; } echo 'style="background-image: url(' . esc_url(get_header_image()) . ')"'; } function asycom_get_background( $bg ) { if ( ! is_null( $bg ) ) { echo 'style="background-image: url(' . esc_url( $bg ) . ');"'; } } function asycom_thumbnail_bg ( ) { if (has_post_thumbnail()) { $feat_image_url = esc_url(wp_get_attachment_url(get_post_thumbnail_id())); echo 'style="background-image: url(' . esc_url($feat_image_url) . ')"'; } }