div a:hover, .widget_categories ul li a:hover, .widget_recent_entries ul li a:hover, .widget_recent_comments ul li a:hover, .widget_pages ul li a:hover, .widget_meta ul li a:hover, .widget_archive ul li a:hover, .widget_nav_menu ul li a:hover, .entry-blog-widget-title a:hover, .site-footer-menu li a:hover, #site-header-trigger:hover, .site-offcanvas-menu ul li a:hover, .social-icon-wrapper ul li a:hover, .site-header-one .social-icon-wrapper ul li a:hover, .site-offcanvas-header .site-trigger-btn:hover, .site-trigger-bottom:hover, .click-open-btn:hover, .entry-btn-post .btn-common:hover { color: '.esc_attr( $primary_color ) .'; }'; } //background if( $primary_color ){ $output .= '.entry-header-wrapper .post-categories a:before, .entry-tags-links a:hover, .site-comment-text span.reply a:hover, .site-top-footer .tagcloud a:hover, .btn-dark:hover, #site-header-trigger:hover .site-icon-bar, #site-header-trigger:hover .site-icon-bar:after, #site-header-trigger:hover .site-icon-bar:before, .not-found .search-button, .site-footer-one .site-footer-social-icon li a:hover, .site-footer-two .site-footer-social-icon li a:hover { background: '.esc_attr( $primary_color ) .'; }'; } //border if( $primary_color ){ $output .= '.entry-tags-links a:hover, .site-top-footer .tagcloud a:hover { border-color: '.esc_attr( $primary_color ) .'; }'; } // hover color $secendary_color = get_theme_mod( 'secendary_color', '#dcb20e' ); if( $secendary_color ){ $output .= 'a:hover, a:active{ color: '.esc_attr( $secendary_color ) .'; }'; } //body color $output .= 'body{ color: '.esc_attr( get_theme_mod( 'body_color', '#fff' ) ) .'; }'; $output .= 'body{ background-color: '.esc_attr( get_theme_mod( 'body_bg', '#1d1b1d' ) ) .'; }'; $body_bg_img = get_theme_mod( 'body_bg_img', get_parent_theme_file_uri( '/assets/images/bg-image.jpg' ) ); if( $body_bg_img ) { $output .= 'body{ background-image: url('.esc_attr( $body_bg_img ).');}'; } //button $btn_color = get_theme_mod( 'btn_color', '#000' ); $btn_hover_color = get_theme_mod( 'btn_hover_color', '#f1c30f' ); $btn_bg = get_theme_mod( 'btn_bg', '#f1c30f' ); $btn_hover_bg = get_theme_mod( 'btn_hover_bg', '#000' ); $btn_border_color = get_theme_mod( 'btn_border_color', '#f1c30f' ); $btn_border_hover_color = get_theme_mod( 'btn_border_hover_color', '#E4282C' ); if( $btn_color ){ $output .= 'button, input[type="button"], input[type="reset"], input[type="submit"], .entry-layout-inside .nav-links .page-numbers:hover, .entry-layout-inside .nav-links .page-numbers.current, .site-comment-text span.reply a { color: '.esc_attr( $btn_color ) .'; }'; } if( $btn_hover_color ){ $output .= '.site-btn-primary:hover, input[type="button"]:hover, input[type="reset"]:hover, input[type="submit"]:hover,.post-categories a:hover, .widget_search .search-button:hover, .site-footer-one .site-footer-social-icon li a:hover, .site-comment-text span.reply a:hover { color: '.esc_attr( $btn_hover_color ) .'; }'; } if( $btn_bg ){ $output .= '.post-categories a, .site-footer-one .site-footer-social-icon li a, .site-comment-text span.reply a, .widget_search .search-button, .entry-layout-inside .nav-links .page-numbers.current, .entry-layout-inside .nav-links .page-numbers:hover { background: '.esc_attr( $btn_bg ) .'; }'; } if( $btn_hover_bg ){ $output .= '.post-categories a:hover,.site-footer-one .site-footer-social-icon li a:hover, .site-comment-text span.reply a:hover, .widget_search .search-button:hover { background: '.esc_attr( $btn_hover_bg ) .'; }'; } if( $btn_border_color ){ $output .= '.site-btn-primary, .site-btn-primary, button, input[type="button"], input[type="reset"], input[type="submit"] { border-bottom-color: '.esc_attr( $btn_border_color ) .'; }'; } if( $btn_border_hover_color ){ $output .= '.site-btn-primary:hover, button, input[type="button"]:hover, input[type="reset"]:hover, input[type="submit"]:hover{ border-top-color: '.esc_attr( $btn_border_hover_color ) .'; }'; } //menu color $menu_color = get_theme_mod( 'menu_color', '' ); if( $menu_color ){ $output .= '.site-header ul.primary-menu > li > a { color: '.esc_attr( $menu_color ) .'; }'; } $output .= 'ul.primary-menu > li.menu-item-has-children.current-menu-item:after, ul.primary-menu > li.menu-item-has-children:hover:after{ color: '.esc_attr( get_theme_mod( 'menu_hover_color', '#fff' ) ) .'; } .site-menu-wrap ul.primary-menu > li > a:after, .site-menu-wrap ul.primary-menu > li > a:hover:before, .site-menu-wrap ul.primary-menu > li.current-menu-item > a:before, .site-menu-wrap ul.primary-menu > li.menu-item-has-children:hover > a:before { background:'.esc_attr( get_theme_mod( 'menu_hover_color', '#fff' ) ) .'; }'; $output .= 'ul.primary-menu ul { background: '.esc_attr( get_theme_mod( 'submenu_bg_color', '#f1c30f' ) ) .'; }'; $output .= 'ul.sub-menu li a, ul.sub-menu > li.menu-item-has-children:after { color: '.esc_attr( get_theme_mod( 'submenu_color', '#000' ) ) .'; }'; $output .= 'ul.sub-menu li a:hover{ color: '.esc_attr( get_theme_mod( 'submenu_hover_color', '#353535' ) ) .'; }'; // "Footer Top Options" $output .= '.site-top-footer{ padding-top: '.esc_attr( get_theme_mod( 'ft_padding_top', '60' ) ) .'px; }'; $output .= '.site-top-footer{ padding-bottom: '.esc_attr( get_theme_mod( 'ft_padding_bottom', '60' ) ) .'px; }'; // "Footer Options" $output .= '.site-footer-info{ padding-top: '.esc_attr( get_theme_mod( 'fb_padding_top', '30' ) ) .'px; }'; $output .= '.site-footer-info{ padding-bottom: '.esc_attr( get_theme_mod( 'fb_padding_bottom', '30' ) ) .'px; }'; return $output; } } //theme setup if ( ! function_exists( 'blogzy_setup' ) ) : function blogzy_setup() { //add language string load_theme_textdomain( 'blogzy', get_template_directory() . '/languages' ); // Add default posts and comments RSS feed links to head. add_theme_support( 'automatic-feed-links' ); add_theme_support( 'title-tag' ); add_theme_support( 'post-thumbnails' ); // Registe wp_nav_menu register_nav_menus( array( 'primary' => __( 'Primary Menu', 'blogzy' ), 'footer-menu' => __( 'Footer Menu', 'blogzy' ) ) ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', ) ); add_theme_support( 'custom-header', array( 'width' => 1920, 'height' => 380, 'flex-height' => true, 'wp-head-callback' => 'blogzy_header_style', )); # Set up the WordPress core custom background feature. add_theme_support( 'custom-background', array( 'default-color' => 'ffffff', )); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); # Enable support for custom logo. // Add custom styles for visual editor to resemble the theme style. add_theme_support( 'wp-block-styles' ); add_theme_support( 'align-wide' ); add_theme_support( 'editor-styles' ); add_editor_style( array( 'assets/css/editor-style.css' ) ); // Gutenberg support add_theme_support( 'editor-color-palette', array( array( 'name' => esc_html__( 'Tan', 'blogzy' ), 'slug' => 'tan', 'color' => '#D2B48C', ), array( 'name' => esc_html__( 'Yellow', 'blogzy' ), 'slug' => 'yellow', 'color' => '#FDE64B', ), array( 'name' => esc_html__( 'Orange', 'blogzy' ), 'slug' => 'orange', 'color' => '#ED7014', ), array( 'name' => esc_html__( 'Red', 'blogzy' ), 'slug' => 'red', 'color' => '#D0312D', ), array( 'name' => esc_html__( 'Pink', 'blogzy' ), 'slug' => 'pink', 'color' => '#b565a7', ), array( 'name' => esc_html__( 'Purple', 'blogzy' ), 'slug' => 'purple', 'color' => '#A32CC4', ), array( 'name' => esc_html__( 'Blue', 'blogzy' ), 'slug' => 'blue', 'color' => '#4E97D8', ), array( 'name' => esc_html__( 'Green', 'blogzy' ), 'slug' => 'green', 'color' => '#00B294', ), array( 'name' => esc_html__( 'Brown', 'blogzy' ), 'slug' => 'brown', 'color' => '#231709', ), array( 'name' => esc_html__( 'Grey', 'blogzy' ), 'slug' => 'grey', 'color' => '#7D7D7D', ), array( 'name' => esc_html__( 'Black', 'blogzy' ), 'slug' => 'black', 'color' => '#000000', ), )); add_theme_support( 'editor-font-sizes', array( array( 'name' => esc_html__( 'small', 'blogzy' ), 'shortName' => esc_html__( 'S', 'blogzy' ), 'size' => 12, 'slug' => 'small' ), array( 'name' => esc_html__( 'regular', 'blogzy' ), 'shortName' => esc_html__( 'M', 'blogzy' ), 'size' => 16, 'slug' => 'regular' ), array( 'name' => esc_html__( 'larger', 'blogzy' ), 'shortName' => esc_html__( 'L', 'blogzy' ), 'size' => 36, 'slug' => 'larger' ), array( 'name' => esc_html__( 'huge', 'blogzy' ), 'shortName' => esc_html__( 'XL', 'blogzy' ), 'size' => 48, 'slug' => 'huge' ) )); add_image_size( 'blogzy-1140-600', 1140, 600, true ); } endif; add_action( 'after_setup_theme', 'blogzy_setup' ); function blogzy_content_width() { global $content_width; $GLOBALS['content_width'] = apply_filters( 'blogzy_content_width', 640 ); } add_action( 'after_setup_theme', 'blogzy_content_width', 0 ); //header style if( ! function_exists( 'blogzy_header_style' ) ): function blogzy_header_style(){ $header_text_color = get_header_textcolor(); if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) { return; } ?> esc_html__( 'Sidebar', 'blogzy' ), 'id' => 'sidebar-1', 'description' => esc_html__( 'Add widgets here.', 'blogzy' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Offcanvas', 'blogzy' ), 'id' => 'offcanavs-1', 'description' => esc_html__( 'Add widgets here.', 'blogzy' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); for( $i = 1; $i <= 4; $i++ ){ register_sidebar( array( 'name' => esc_html__( 'Footer', 'blogzy' ) . $i, 'id' => 'site-footer-sidebar-' . $i, 'description' => esc_html__( 'Add widgets here.', 'blogzy' ), 'before_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } } add_action( 'widgets_init', 'blogzy_widgets_init' ); /** * Enqueue scripts and styles for Frontend. */ function blogzy_scripts() { wp_enqueue_style( 'blogzy-google-font-style', '//fonts.googleapis.com/css?family=Heebo:100,300,400,500,700,800,900', false ); wp_enqueue_style( 'blogzy-cbfont', BLOGZY_URI . '/assets/css/cbfont.css', null, 'all' ); wp_enqueue_style( 'blogzy-grid', BLOGZY_URI . '/assets/css/grid.css', null, 'all' ); wp_enqueue_style( 'blogzy-blocks-styles', BLOGZY_URI . '/assets/css/blocks.css', null, 'all' ); wp_enqueue_style( 'blogzy-style', get_stylesheet_uri() ); if ( has_nav_menu( 'primary' ) ) { wp_enqueue_script( 'blogzy-navigation', BLOGZY_URI . '/assets/js/navigation.js', array(), BLOGZY_VERSION, true ); } wp_enqueue_script( 'blogzy-main', BLOGZY_URI . '/assets/js/main.js', array('jquery'), BLOGZY_VERSION, true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } wp_add_inline_style( 'blogzy-style', blogzy_css_generator() ); } add_action( 'wp_enqueue_scripts', 'blogzy_scripts' ); /** * Enqueue scripts and styles for Editor. */ function blogzy_scripts_editor() { wp_enqueue_style( 'blogzy-google-font-style', '//fonts.googleapis.com/css?family=Heebo:100,300,400,500,700,800,900', false ); } add_action('enqueue_block_editor_assets', 'blogzy_scripts_editor'); /** * Add Body Class */ function blogzy_body_classes( $classes ) { if ( ! is_singular() ) { $classes[] = 'hfeed'; } if ( ! is_active_sidebar( 'sidebar-1' ) ) { $classes[] = 'no-sidebar'; } // $skin = get_theme_mod( 'skin_style', 'white' ); // $classes[] = 'site-'.$skin; return $classes; } add_filter( 'body_class', 'blogzy_body_classes' ); /** * Add a pingback url auto-discovery header for single posts, pages, or attachments. */ function blogzy_pingback_header() { if ( is_singular() && pings_open() ) { printf( '', esc_url( get_bloginfo( 'pingback_url' ) ) ); } } add_action( 'wp_head', 'blogzy_pingback_header' ); /** * footer widget active check */ function blogzy_is_active_footer_sidebar(){ for( $i = 1; $i <= 4; $i++ ){ if ( is_active_sidebar( 'site-footer-sidebar-'.$i ) ) : return true; endif; } return false; } /** * Excerpt */ if(!function_exists('blogzy_excerpt_max_charlength')): function blogzy_excerpt_max_charlength($charlength) { $excerpt = get_the_excerpt(); $charlength++; if ( mb_strlen( $excerpt ) > $charlength ) { $subex = mb_substr( $excerpt, 0, $charlength - 5 ); $exwords = explode( ' ', $subex ); $excut = - ( mb_strlen( $exwords[ count( $exwords ) - 1 ] ) ); if ( $excut < 0 ) { return mb_substr( $subex, 0, $excut ); } else { return $subex; } } else { return $excerpt; } } endif; /** * Comment List */ function blogzy_comments($comment, $args, $depth) { ?>
  • id="comment-">
    __('Reply', 'blogzy'), 'depth' => $depth, 'max_depth' => $args['max_depth'])), $comment->comment_ID); ?> comment_approved == '0') : ?>
  • esc_html__( 'Gutenberg Post Blocks', 'blogzy' ), 'slug' => 'ultimate-post', 'source' => esc_url('https://downloads.wordpress.org/plugin/ultimate-post.zip'), 'required' => false, 'version' => '', 'force_activation' => false, 'force_deactivation' => false, 'external_url' => '', ), ); $config = array( 'id' => 'blogzy', // Unique ID for hashing notices for multiple instances of TGMPA. 'default_path' => '', // Default absolute path to bundled plugins. 'menu' => 'tgmpa-install-plugins', // Menu slug. 'has_notices' => true, // Show admin notices or not. 'dismissable' => true, // If false, a user cannot dismiss the nag message. 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. 'is_automatic' => false, // Automatically activate plugins after installation or not. 'message' => '', // Message to output right before the plugins table. ); tgmpa( $plugins, $config ); } endif;