', '', '' ); ?>
* @version 0.0.0 * @textdoman vlogger */ /**========================================================================================== * * * Themes2go Warranty Notice: * Theme's support doesn't cover any code customizations. You are free to edit any theme's code at your own risk. * For any customization please use the provided child theme instead of editing core files. * https://codex.wordpress.org/Child_Themes * * ==========================================================================================*/ /** * * Theme version definition to prevent caching of old files * ============================================= */ if(!function_exists('vlogger_theme_version')){ function vlogger_theme_version(){ $my_theme = wp_get_theme( ); return $my_theme->get( 'Version' ); } } /** * * TGM Plugins Activation * Automatic plugins installation * ============================================= */ require_once get_template_directory() . '/TGM-Plugin-Activation/vlogger-plugins-activation-CONNECTOR.php'; /**========================================================================================== * * * Connector settings * * ==========================================================================================*/ if ( class_exists( 'T2gConnectorClient' ) ) { include(get_template_directory().'/T2G-connector-client/t2gconnectorclient-config.php'); } /** * * content_width * ============================================= */ if ( ! isset( $content_width ) ) $content_width = 1170; /** * * TTG CORE DATA * For custom types fields and appearance customizer * ============================================= */ if(function_exists('ttg_core_active')){ /* types settings */ include(get_template_directory().'/ttgcore-setup/custom-types/pages-special/pages-special.php'); include(get_template_directory().'/ttgcore-setup/custom-types/post-special/post-special.php'); include(get_template_directory().'/ttgcore-setup/custom-types/series/series-type.php'); /* Customizer */ // Early exit if Kirki is not installed if ( class_exists( 'Kirki' ) ) { include( get_template_directory().'/ttgcore-setup/customizer/kirki-configuration/sections.php' ); include( get_template_directory().'/ttgcore-setup/customizer/kirki-configuration/fields.php' ); include( get_template_directory().'/ttgcore-setup/customizer/kirki-configuration/configuration.php' ); include( get_template_directory().'/phpincludes/customizations.php' ); } /* Shortcode settings */ include(get_template_directory()."/ttgcore-setup/short/short-carousel-videos.php"); include(get_template_directory()."/ttgcore-setup/short/short-post-grid.php"); include(get_template_directory()."/ttgcore-setup/short/short-buttons.php"); include(get_template_directory()."/ttgcore-setup/short/short-captions.php"); include(get_template_directory()."/ttgcore-setup/short/short-spacer.php"); include(get_template_directory()."/ttgcore-setup/short/short-carousel-posts.php"); include(get_template_directory()."/ttgcore-setup/short/short-carousel-medium.php"); include(get_template_directory()."/ttgcore-setup/short/short-customcard.php"); include(get_template_directory()."/ttgcore-setup/short/short-slideshow-3d.php"); include(get_template_directory()."/ttgcore-setup/short/short-slideshow.php"); include(get_template_directory()."/ttgcore-setup/short/short-carousel-series.php"); include(get_template_directory()."/ttgcore-setup/short/short-post-hero.php"); include(get_template_directory()."/ttgcore-setup/short/short-series-grid.php"); } /* * * Setup * ============================================= */ if ( ! function_exists( 'vlogger_setup' ) ) { function vlogger_setup() { load_theme_textdomain( "vlogger", get_template_directory() . '/languages' ); add_theme_support( 'automatic-feed-links' ); add_theme_support( 'post-thumbnails' ); add_theme_support( 'title-tag' ); add_theme_support( 'editor_style'); //add_theme_support( 'vlogger' ); /* = We have to add the required images sizes ==============================================*/ set_post_thumbnail_size( 170, 170, true ); add_image_size( 'vlogger-m', 670, 670, true ); /* = post formats support ==============================================*/ add_theme_support( 'post-formats', array( 'video' ) ); /* = Register the menu after_menu_locations_table ==============================================*/ register_nav_menus( array( 'vlogger_menu_primary' => esc_html__( 'Primary Menu', "vlogger" ), )); register_nav_menus( array( 'vlogger_menu_secondary' => esc_html__( 'Secondary Menu', "vlogger" ), )); register_nav_menus( array( 'vlogger_menu_footer' => esc_html__( 'Footer Menu', "vlogger" ), )); }} add_action( 'after_setup_theme', 'vlogger_setup' ); /* * * Change default thumbnails sizes * ============================================= */ add_action('after_switch_theme', 'vlogger_setup_options'); function vlogger_setup_options () { update_option( 'medium_size_w', 670 ); update_option( 'medium_size_h', 670 ); update_option( 'large_size_w', 1170 ); update_option( 'large_size_h', 658 ); } /** * * Register sidebars * ============================================= */ if(!function_exists('vlogger_widgets_init')){ function vlogger_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Right Sidebar', "vlogger" ), 'id' => 'vlogger-right-sidebar', 'before_widget' => '' )); register_sidebar( array( 'name' => esc_html__( 'Footer Sidebar', "vlogger" ), 'id' => 'vlogger-footersidebar', 'before_widget' => '' )); /** * Series sidebar */ register_sidebar( array( 'name' => esc_html__( 'Series Sidebar', "vlogger" ), 'id' => 'vlogger-seriessidebar', 'before_widget' => '' )); }} add_action( 'widgets_init', 'vlogger_widgets_init' ); /* Register Fonts */ function vlogger_fonts_url() { $font_url = ''; /* Translators: If there are characters in your language that are not supported by chosen font(s), translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Google font: on or off', 'vlogger' ) ) { $font_url = add_query_arg( 'family', urlencode( 'Montserrat:700,400|Open+Sans:300,400,700' ), "//fonts.googleapis.com/css" ); } return $font_url; } /** * CSS and Js loading * ============================================= */ if(!function_exists('vlogger_files_inclusion')){ function vlogger_files_inclusion() { // CSS wp_enqueue_style( "dripicons", get_template_directory_uri().'/fonts/dripicons/webfont.css', false, vlogger_theme_version(), "all" ); wp_enqueue_style( "qticons", get_template_directory_uri().'/fonts/qticons/qticons.css', false, vlogger_theme_version(), "all" ); wp_enqueue_style( "google-icons", get_template_directory_uri().'/fonts/google-icons/material-icons.css', false, vlogger_theme_version(), "all" ); wp_enqueue_style( "socicons", get_template_directory_uri().'/fonts/socicon/style.css' ); wp_enqueue_style( "slick", get_template_directory_uri().'/components/slick/slick.css', false, vlogger_theme_version(), "all" ); wp_enqueue_style( "vlogger_main", get_template_directory_uri().'/css/ttg-main.css', false, vlogger_theme_version(), "all" ); if(!function_exists('ttg_core_active')){ wp_enqueue_style( 'vlogger-fonts', vlogger_fonts_url(), array(), '1.0.0' ); add_action( 'wp_enqueue_scripts', 'vlogger_scripts' ); wp_enqueue_style( "vlogger_typography", get_template_directory_uri().'/css/ttg-typography.css', false, vlogger_theme_version(), "all" ); } // js $deps = array("jquery", "imagesloaded", "masonry" ); /** * Twitch API can't be embedded in the theme's JS minified file as it relies on the js URL */ if(get_theme_mod( 'vlogger_enable_twitch', false )){ wp_enqueue_script( 'twitch', 'http://player.twitch.tv/js/embed/v1.js', $deps, vlogger_theme_version(), true ); $deps[] = 'twitch'; } /** * Import youtube google api only if I'm using the channel tag */ if(get_theme_mod( 'vlogger_yt_channel', false )){ wp_enqueue_script( 'googleapi', 'https://apis.google.com/js/platform.js', $deps, vlogger_theme_version(), true ); $deps[] = 'googleapi'; } if(get_theme_mod('vlogger_sticky_sidebar', false )){ } if(get_theme_mod("vlogger_enable_debug", 0) == "1"){ wp_enqueue_script( 'plyr', get_template_directory_uri().'/components/plyr/src/js/plyr.js', $deps, vlogger_theme_version(), true ); $deps[] = 'plyr'; wp_enqueue_script( 'materializecss', get_template_directory_uri().'/js/materialize-src/js/bin/materialize.min.js', $deps, vlogger_theme_version(), true ); $deps[] = 'materializecss'; wp_enqueue_script( 'slick', get_template_directory_uri().'/components/slick/slick.min.js', $deps, vlogger_theme_version(), true ); $deps[] = 'slick'; wp_enqueue_script( 'waypoints', get_template_directory_uri().'/components/waypoints/jquery.waypoints.js', $deps, vlogger_theme_version(), true ); $deps[] = 'waypoints'; wp_enqueue_script( 'skrollr', get_template_directory_uri().'/components/skrollr/skrollr.min.js', $deps, vlogger_theme_version(), true ); $deps[] = 'skrollr'; wp_enqueue_script( 'vlogger_main', get_template_directory_uri().'/js/ttg-main.js', $deps, vlogger_theme_version(), true ); $deps[] = 'vlogger_main'; } else { wp_enqueue_script( 'vlogger_main', get_template_directory_uri().'/js/min/ttg-main-min.js', $deps, vlogger_theme_version(), true ); $deps[] = 'vlogger_main'; } if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } }} add_action( 'wp_enqueue_scripts', 'vlogger_files_inclusion' ); /** * * Editor style * ============================================= * */ function vlogger_add_editor_styles() { add_editor_style( get_template_directory_uri().'/css/editor.css' ); } add_action( 'init', 'vlogger_add_editor_styles' ); /** * * Get universal page id * ============================================= * */ if ( ! function_exists( 'vlogger_universal_page_id' ) ) { function vlogger_universal_page_id() { $pageid = get_the_ID(); if(function_exists('is_shop') && function_exists('is_checkout') && function_exists('is_account_page') && function_exists('is_wc_endpoint_url')){ if(is_shop()){ $pageid = get_option( 'woocommerce_shop_page_id' ); } elseif (is_cart()){ $pageid = get_option( 'woocommerce_cart_page_id' ); }elseif (is_checkout()){ $pageid = get_option( 'woocommerce_checkout_page_id' ); }elseif (is_account_page()){ $pageid = get_option( 'woocommerce_myaccount_page_id' ); }elseif (is_wc_endpoint_url( 'order-pay' )){ $pageid = get_option( 'woocommerce_pay_page_id' ); }elseif (is_wc_endpoint_url( 'order-received' )){ $pageid = get_option( 'woocommerce_thanks_page_id' ); }elseif (is_wc_endpoint_url( 'view-order' ) ){ $pageid = get_option( 'woocommerce_view_order_page_id' ); }elseif (is_wc_endpoint_url( 'edit-account' ) ){ $pageid = get_option( 'woocommerce_myaccount_page_id' ); }elseif (is_wc_endpoint_url( 'edit-address' )){ $pageid = get_option( 'woocommerce_edit_address_page_id' ); }elseif (is_wc_endpoint_url( 'lost-password' )){ $pageid = get_option( 'woocommerce_checkout_page_id' ); }elseif (is_wc_endpoint_url( 'customer-logout' )){ $pageid = get_option( 'woocommerce_checkout_page_id' ); }elseif (is_wc_endpoint_url( 'add-payment-method' )){ $pageid = get_option( 'woocommerce_shop_page_id' ); } } return $pageid; }} /** * * Get universal header transparency * ============================================= * */ if ( ! function_exists( 'vlogger_get_universal_header_transparency' ) ) { function vlogger_get_universal_header_transparency() { $pageid = vlogger_universal_page_id(); $header_transparency = "qt-header-opaque"; if( (get_theme_mod("vlogger_header_transparent") == "1" || get_post_meta($pageid,"vlogger_header_transparent", true) == "1" ) ){ if(get_post_meta($pageid,"vlogger_header_transparent", true) !== "0") { $header_transparency = "qt-header-transparent"; } } if(is_search() || vlogger_get_paged() > 1){ $header_transparency = "qt-header-opaque"; } return $header_transparency; }} /** * * Add class right to secondary menu items * ============================================= * */ function vlogger_secondary_menu_classes( $classes, $item, $args ) { // Only affect the menu placed in the 'secondary' wp_nav_bar() theme location if ( 'vlogger_menu_secondary' === $args->theme_location ) { // Make these items 3-columns wide in Bootstrap $classes[] = 'right'; } return $classes; } add_filter( 'nav_menu_css_class', 'vlogger_secondary_menu_classes', 10, 3 ); /** * * Add class right to footer menu items * ============================================= * */ function vlogger_footer_menu_classes( $classes, $item, $args ) { // Only affect the menu placed in the 'secondary' wp_nav_bar() theme location if ( 'vlogger_menu_footer' === $args->theme_location ) { // Make these items 3-columns wide in Bootstrap $classes[] = 'qt-right'; } return $classes; } add_filter( 'nav_menu_css_class', 'vlogger_footer_menu_classes', 10, 3 ); /** * * User special fields * ============================================= */ if ( ! function_exists( 'vlogger_playicon' ) ) { function vlogger_playicon ( $id = false) { if('video' == get_post_format( $id )){ return ''; } return; }} /** * * Icon by post format * ============================================= * */ if ( ! function_exists( 'vlogger_format_icon_class' ) ) { function vlogger_format_icon_class ( $id = false) { if ( false === $id ) { return; } else { $format = get_post_format( $id ); if ( false === $format ) { $format = 'post'; } switch ($format){ case "video": echo 'dripicons-media-play'; break; case "audio": echo 'dripicons-music'; break; case "gallery": echo 'dripicons-camera'; break; case "image": echo 'dripicons-camera'; break; case "link": echo 'dripicons-link'; break; case "chat": echo 'dripicons-conversation'; break; case "post": case "aside": case "quote": default: echo 'dripicons-align-justify'; break; } } }} /** * Create the proper date formatted text * ============================================= */ if(!function_exists('vlogger_international_date')) { function vlogger_international_date(){ the_time( get_option( "date_format", "d M Y" ), '', '', true ); }} /** * * User special fields * ============================================= */ function vlogger_get_qt_user_social(){ $qt_user_social = array( "twitter" => array( 'label' => esc_html__( 'Twitter Url' , "vlogger" ), 'icon' => "qticon-twitter" ) ,"facebook" => array( 'label' => esc_html__( 'Facebook Url' , "vlogger" ), 'icon' => "qticon-facebook" ) ,"google" => array( 'label' => esc_html__( 'Google Url' , "vlogger" ), 'icon' => "qticon-google" ) ,"flickr" => array( 'label' => esc_html__( 'Flickr Url' , "vlogger" ), 'icon' => "qticon-flickr" ) ,"pinterest" => array( 'label' => esc_html__( 'Pinterest Url' , "vlogger" ), 'icon' => "qticon-pinterest" ) ,"amazon" => array( 'label' => esc_html__( 'Amazon Url' , "vlogger" ), 'icon' => "qticon-amazon" ) ,"github" => array( 'label' => esc_html__( 'Github Url' , "vlogger" ), 'icon' => "fa fa-github-alt" ) ,"soundcloud" => array( 'label' => esc_html__( 'Soundcloud Url' , "vlogger" ), 'icon' => "qticon-cloud" ) ,"vimeo" => array( 'label' => esc_html__( 'Vimeo Url' , "vlogger" ), 'icon' => "qticon-vimeo" ) ,"tumblr" => array( 'label' => esc_html__( 'Tumblr Url' , "vlogger" ), 'icon' => "qticon-tumblr" ) ,"youtube" => array( 'label' => esc_html__( 'Youtube Url' , "vlogger" ), 'icon' => "qticon-youtube" ) ,"wordpress" => array( 'label' => esc_html__( 'WordPress Url' , "vlogger" ), 'icon' => "qticon-wordpress" ) ,"wikipedia" => array( 'label' => esc_html__( 'Wikipedia Url' , "vlogger" ), 'icon' => "qticon-wikipedia" ) ,"instagram" => array( 'label' => esc_html__( 'Instagram Url' , "vlogger" ), 'icon' => "qticon-instagram" ) ); return $qt_user_social; } $qt_user_social = vlogger_get_qt_user_social(); /** * * Create user social icons * ============================================= */ if(!function_exists('vlogger_user_social_icons')) { function vlogger_user_social_icons($id = null){ if(null === $id){ return; } $qt_user_social = vlogger_get_qt_user_social(); foreach($qt_user_social as $var => $val){ $link = get_the_author_meta( $var , $id); if(!empty($link)){ ?> request; $posts_per_page = intval(get_query_var('posts_per_page')); $paged = vlogger_get_paged(); $numposts = $wp_query->found_posts; $max_page = $wp_query->max_num_pages; if(empty($paged) || $paged == 0) { $paged = 1; } $pages_to_show = 7; $pages_to_show_minus_1 = $pages_to_show-1; $half_page_start = floor($pages_to_show_minus_1/2); $half_page_end = ceil($pages_to_show_minus_1/2); $start_page = $paged - $half_page_start; if($start_page <= 0) { $start_page = 1; } $end_page = $paged + $half_page_end; if(($end_page - $start_page) != $pages_to_show_minus_1) { $end_page = $start_page + $pages_to_show_minus_1; } if($end_page > $max_page) { $start_page = $max_page - $pages_to_show_minus_1; $end_page = $max_page; } if($start_page <= 0) { $start_page = 1; } if ($paged > 1) { ?>
', '', '' ); ?>