esc_attr__('Primary Menu', 'beatmix_lite'), 'secondary-nav' => esc_attr__('Secondary Menu', 'beatmix_lite'), 'footer-nav' => esc_attr__('Footer Menu', 'beatmix_lite'), )); add_filter('beatmix_lite_customization_init_options', 'beatmix_lite_init_options'); add_action('widgets_init', 'beatmix_lite_register_sidebar'); if (!is_admin()){ add_action('wp_enqueue_scripts', 'beatmix_lite_enqueue_scripts'); add_filter('body_class', 'beatmix_lite_body_class'); add_filter('excerpt_more', '__return_false'); } } function beatmix_lite_register_new_image_sizes(){ add_image_size('beatmix_lite_blog_once_col', 1050, 579, true); add_image_size('beatmix_lite_blog_masonry', 271, null, false); add_image_size('beatmix_lite_single', 1050, 470, true); } function beatmix_lite_enqueue_scripts(){ global $post, $wp_styles, $is_IE; $dir = get_template_directory_uri(); /* * -------------------------------------------------- * STYLESHEET * -------------------------------------------------- */ wp_enqueue_style( 'twentyfifteen-fonts', beatmix_lite_fonts_url(), array(), null ); wp_enqueue_style('beatmix_lite-bootstrap', "{$dir}/css/bootstrap.css", array(), NULL); wp_enqueue_style('beatmix_lite-font-awesome', "{$dir}/css/font-awesome.css", array(), NULL); wp_enqueue_style('beatmix_lite-navgoco', "{$dir}/css/jquery.navgoco.css", array(), NULL); wp_enqueue_style('beatmix_lite-superfish', "{$dir}/css/superfish.css", array(), NULL); wp_enqueue_style('beatmix_lite-owl-carousel', "{$dir}/css/owl.carousel.css", array(), NULL); wp_enqueue_style('beatmix_lite-owl-theme', "{$dir}/css/owl.theme.css", array(), NULL); wp_enqueue_style('beatmix_lite-style', get_stylesheet_uri(), array(), NULL); wp_enqueue_style('beatmix_lite-responsive', "{$dir}/css/responsive.css", array(), NULL); $header_background = get_theme_mod('header-background', false); if($header_background){ $custom_style = sprintf(".page-header-bg {background: url('%s') repeat fixed 0 top;}", $header_background); wp_add_inline_style('beatmix_lite-style', $custom_style); } /* * -------------------------------------------------- * JAVASCRIPT * -------------------------------------------------- */ if (is_singular()) wp_enqueue_script('comment-reply'); wp_enqueue_script('jquery'); wp_enqueue_script('masonry'); wp_enqueue_script('beatmix_lite-modernizr', "{$dir}/js/modernizr.js", array('jquery'), NULL, TRUE); wp_enqueue_script('beatmix_lite-bootstrap', "{$dir}/js/bootstrap.js", array('jquery'), NULL, TRUE); wp_enqueue_script('beatmix_lite-fitvids', "{$dir}/js/fitvids.js", array('jquery'), NULL, TRUE); wp_enqueue_script('beatmix_lite-imagesloaded', "{$dir}/js/imagesloaded.js", array('jquery'), NULL, TRUE); wp_enqueue_script('beatmix_lite-caroufredsel', "{$dir}/js/jquery.caroufredsel.js", array('jquery'), NULL, TRUE); wp_enqueue_script('beatmix_lite-matchheight', "{$dir}/js/jquery.matchheight.js", array('jquery'), NULL, TRUE); wp_enqueue_script('beatmix_lite-navgoco', "{$dir}/js/jquery.navgoco.js", array('jquery'), NULL, TRUE); wp_enqueue_script('beatmix_lite-owl-carousel', "{$dir}/js/owl.carousel.js", array('jquery'), NULL, TRUE); wp_enqueue_script('beatmix_lite-superfish', "{$dir}/js/superfish.js", array('jquery'), NULL, TRUE); wp_enqueue_script('beatmix_lite-visible', "{$dir}/js/visible.js", array('jquery'), NULL, TRUE); wp_enqueue_script('beatmix_lite-custom', "{$dir}/js/custom.js", array('jquery'), NULL, TRUE); wp_localize_script('beatmix_lite-custom', 'beatmix_lite_vars', array()); } function beatmix_lite_body_class($classes){ array_push($classes, 'kopa-sub-page'); if(is_archive() || is_home()){ array_push($classes, 'categories-1'); }elseif(is_singular()){ array_push($classes, 'kopa-single-page', 'kopa-subpage'); } return $classes; } function beatmix_lite_fonts_url() { $fonts_url = ''; $fonts = array(); $subsets = 'latin,latin-ext'; /* * Translators: If there are characters in your language that are not supported * by Source Sans Pro, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Source Sans Pro', 'beatmix_lite' ) ) { $fonts[] = 'Source Sans Pro:400,200,300,600,700,400italic,300italic'; } /* * Translators: If there are characters in your language that are not supported * by Lato, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Lato', 'beatmix_lite' ) ) { $fonts[] = 'Lato:400,700,300'; } /* * Translators: To add an additional character subset specific to your language, * translate this to 'greek', 'cyrillic', 'devanagari' or 'vietnamese'. Do not translate into your own language. */ $subset = _x( 'no-subset', 'Add new subset (greek, cyrillic, devanagari, vietnamese)', 'beatmix_lite' ); if ( 'cyrillic' == $subset ) { $subsets .= ',cyrillic,cyrillic-ext'; } elseif ( 'greek' == $subset ) { $subsets .= ',greek,greek-ext'; } elseif ( 'devanagari' == $subset ) { $subsets .= ',devanagari'; } elseif ( 'vietnamese' == $subset ) { $subsets .= ',vietnamese'; } if ( $fonts ) { $fonts_url = add_query_arg( array( 'family' => urlencode( implode( '|', $fonts ) ), 'subset' => urlencode( $subsets ), ), 'https://fonts.googleapis.com/css' ); } return $fonts_url; } function beatmix_lite_init_options($options){ $options['sections'][] = array( 'id' => 'beatmix_lite_opt_header', 'title' => esc_attr__('Header', 'beatmix_lite')); $options['sections'][] = array( 'id' => 'beatmix_lite_opt_footer', 'title' => esc_attr__('Footer', 'beatmix_lite')); $options['sections'][] = array( 'id' => 'beatmix_lite_opt_socials', 'title' => esc_attr__('Social links', 'beatmix_lite')); $options['sections'][] = array( 'id' => 'beatmix_lite_opt_blog', 'title' => esc_attr__('Blog posts', 'beatmix_lite')); $options['settings'][] = array( 'settings' => 'is_show_signup_links', 'label' => esc_attr__('Is show signup links (header)', 'beatmix_lite'), 'default' => 1, 'type' => 'checkbox', 'section' => 'beatmix_lite_opt_header', 'transport' => 'refresh'); $options['settings'][] = array( 'settings' => 'is_show_headlines', 'label' => esc_attr__('Is show headlines', 'beatmix_lite'), 'default' => 1, 'type' => 'checkbox', 'section' => 'beatmix_lite_opt_header', 'transport' => 'refresh'); $options['settings'][] = array( 'settings' => 'logo', 'label' => esc_attr__('Logo', 'beatmix_lite'), 'description' => esc_attr__('Upload your logo image.', 'beatmix_lite'), 'default' => '', 'type' => 'image', 'section' => 'beatmix_lite_opt_header', 'transport' => 'refresh'); $options['settings'][] = array( 'settings' => 'header-background', 'label' => esc_attr__('Header background', 'beatmix_lite'), 'description' => esc_attr__('Upload your header background image.', 'beatmix_lite'), 'default' => '', 'type' => 'image', 'section' => 'beatmix_lite_opt_header', 'transport' => 'refresh'); $options['settings'][] = array( 'settings' => 'copyright', 'label' => esc_attr__('Copyright', 'beatmix_lite'), 'description' => esc_attr__('Your copyright information on footer.', 'beatmix_lite'), 'default' => '', 'type' => 'textarea', 'section' => 'beatmix_lite_opt_footer', 'transport' => 'refresh'); $options['settings'][] = array( 'settings' => 'blog-layout', 'label' => esc_attr__('Blog layout', 'beatmix_lite'), 'default' => 'one-col', 'type' => 'select', 'choices' => array( 'one-col' => esc_attr__('One col', 'beatmix_lite'), 'masonry' => esc_attr__('Masonry', 'beatmix_lite') ), 'section' => 'beatmix_lite_opt_blog', 'transport' => 'refresh'); $social_links = beatmix_get_socials(); foreach($social_links as $social_slug => $social){ $options['settings'][] = array( 'settings' => $social_slug, 'label' => $social[0], 'default' => '', 'type' => 'text', 'section' => 'beatmix_lite_opt_socials', 'transport' => 'refresh'); } return $options; } function beatmix_lite_register_sidebar(){ $args = array( 'before_widget' => '
', 'before_title' => '