/** * CoverNews functions and definitions * * @link https://developer.wordpress.org/themes/basics/theme-functions/ * * @package CoverNews */ if (!function_exists('covernews_setup')): /** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which * runs before the init hook. The init hook is too late for some features, such * as indicating support for post thumbnails. */ /** * */ /** * */ function covernews_setup() { /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. * If you're building a theme based on CoverNews, use a find and replace * to change 'covernews' to the name of your theme in all the template files. */ load_theme_textdomain('covernews', get_template_directory().'/languages'); // Add default posts and comments RSS feed links to head. add_theme_support('automatic-feed-links'); /* * Let WordPress manage the document title. * By adding theme support, we declare that this theme does not use a * hard-coded tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support('title-tag'); /* * Enable support for Post Thumbnails on posts and pages. * * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ */ add_theme_support('post-thumbnails'); // Add featured image sizes add_image_size('covernews-slider-full', 1536, 1020, true); // width, height, crop add_image_size('covernews-slider-center', 936, 897, true); // width, height, crop add_image_size('covernews-featured', 1024, 0, false ); // width, height, crop add_image_size('covernews-medium', 720, 380, true); // width, height, crop add_image_size('covernews-medium-square', 675, 450, true); // width, height, crop /* * Enable support for Post Formats on posts and pages. * * @link https://developer.wordpress.org/themes/functionality/post-formats/ */ add_theme_support( 'post-formats', array( 'image', 'video', 'gallery' ) ); // This theme uses wp_nav_menu() in one location. register_nav_menus(array( 'aft-primary-nav' => esc_html__('Primary Menu', 'covernews'), 'aft-top-nav' => esc_html__('Top Menu', 'covernews'), 'aft-social-nav' => esc_html__('Social Menu', 'covernews'), 'aft-footer-nav' => esc_html__('Footer Menu', 'covernews'), )); /* * 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', )); // Set up the WordPress core custom background feature. add_theme_support('custom-background', apply_filters('covernews_custom_background_args', array( 'default-color' => 'f5f5f5', 'default-image' => '', ))); // Add theme support for selective refresh for widgets. add_theme_support('customize-selective-refresh-widgets'); /** * Add support for core custom logo. * * @link https://codex.wordpress.org/Theme_Logo */ add_theme_support('custom-logo', array( 'flex-width' => true, 'flex-height' => true, )); /* * Add theme support for gutenberg block */ add_theme_support( 'align-wide' ); } endif; add_action('after_setup_theme', 'covernews_setup'); /** * Demo export/import * * Eventually, some of the functionality here could be replaced by core features. * * @package CoverNews */ if (!function_exists('covernews_ocdi_files')) : /** * OCDI files. * * @since 1.0.0 * * @return array Files. */ function covernews_ocdi_files() { return apply_filters( 'aft_demo_import_files', array( array( 'import_file_name' => esc_html__( 'CoverNews Default', 'covernews' ), 'local_import_file' => trailingslashit( get_template_directory() ) . 'demo-content/default/covernews.xml', 'local_import_widget_file' => trailingslashit( get_template_directory() ) . 'demo-content/default/covernews.wie', 'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'demo-content/default/covernews.dat', 'import_preview_image_url' => trailingslashit( get_template_directory_uri() ) . 'demo-content/assets/covernews.jpg', 'preview_url' => 'https://demo.afthemes.com/covernews/', ), array( 'import_file_name' => esc_html__( 'CoverNews Sport', 'covernews' ), 'local_import_file' => trailingslashit( get_template_directory() ) . 'demo-content/sport/covernews.xml', 'local_import_widget_file' => trailingslashit( get_template_directory() ) . 'demo-content/sport/covernews.wie', 'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'demo-content/sport/covernews.dat', 'import_preview_image_url' => trailingslashit( get_template_directory_uri() ) . 'demo-content/assets/covernews-sport.jpg', 'preview_url' => 'https://demo.afthemes.com/covernews/sport', ), array( 'import_file_name' => esc_html__( 'CoverNews Fashion', 'covernews' ), 'local_import_file' => trailingslashit( get_template_directory() ) . 'demo-content/fashion/covernews.xml', 'local_import_widget_file' => trailingslashit( get_template_directory() ) . 'demo-content/fashion/covernews.wie', 'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'demo-content/fashion/covernews.dat', 'import_preview_image_url' => trailingslashit( get_template_directory_uri() ) . 'demo-content/assets/covernews-fashion.jpg', 'preview_url' => 'https://demo.afthemes.com/covernews/fashion', ), )); } endif; add_filter( 'pt-ocdi/import_files', 'covernews_ocdi_files'); /** * function for google fonts */ if (!function_exists('covernews_fonts_url')): /** * Return fonts URL. * * @since 1.0.0 * @return string Fonts URL. */ function covernews_fonts_url() { $fonts_url = ''; $fonts = array(); $subsets = 'latin,latin-ext'; /* translators: If there are characters in your language that are not supported by Oswald, translate this to 'off'. Do not translate into your own language. */ if ('off' !== _x('on', 'Source Sans Pro font: on or off', 'covernews')) { $fonts[] = 'Source+Sans+Pro:400,400i,700,700i'; } /* 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 font: on or off', 'covernews')) { $fonts[] = 'Lato:400,300,400italic,900,700'; } if ($fonts) { $fonts_url = add_query_arg(array( 'family' => urldecode(implode('|', $fonts)), 'subset' => urldecode($subsets), ), 'https://fonts.googleapis.com/css'); } return $fonts_url; } endif; /** * Set the content width in pixels, based on the theme's design and stylesheet. * * Priority 0 to make it available to lower priority callbacks. * * @global int $content_width */ function covernews_content_width() { $GLOBALS['content_width'] = apply_filters('covernews_content_width', 640); } add_action('after_setup_theme', 'covernews_content_width', 0); /** * Enqueue scripts and styles. */ function covernews_scripts() { $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG?'':'.min'; wp_enqueue_style('font-awesome-v5', get_template_directory_uri().'/assets/font-awesome-v5/css/fontawesome-all'.$min.'.css'); wp_enqueue_style('bootstrap', get_template_directory_uri().'/assets/bootstrap/css/bootstrap'.$min.'.css'); wp_enqueue_style('slick', get_template_directory_uri().'/assets/slick/css/slick'.$min.'.css'); $fonts_url = covernews_fonts_url(); if (!empty($fonts_url)) { wp_enqueue_style('covernews-google-fonts', $fonts_url, array(), null); } if ( class_exists( 'WooCommerce' ) ) { wp_enqueue_style('covernews-woocommerce-style', get_template_directory_uri() . '/assets/woocommerce.css'); } wp_enqueue_style('covernews-style', get_stylesheet_uri()); wp_enqueue_script('covernews-navigation', get_template_directory_uri().'/js/navigation.js', array(), '20151215', true); wp_enqueue_script('covernews-skip-link-focus-fix', get_template_directory_uri().'/js/skip-link-focus-fix.js', array(), '20151215', true); wp_enqueue_script('slick', get_template_directory_uri().'/assets/slick/js/slick'.$min.'.js', array('jquery'), '', true); wp_enqueue_script('bootstrap', get_template_directory_uri().'/assets/bootstrap/js/bootstrap'.$min.'.js', array('jquery'), '', true); wp_enqueue_script('matchheight', get_template_directory_uri().'/assets/jquery-match-height/jquery.matchHeight'.$min.'.js', array('jquery'), '', true); wp_enqueue_script('marquee', get_template_directory_uri() . '/assets/marquee/jquery.marquee.js', array('jquery'), '', true); wp_enqueue_script('sticky-sidebar', get_template_directory_uri() . '/assets/theiaStickySidebar/theia-sticky-sidebar.min.js', array('jquery'), '', true); wp_enqueue_script('covernews-script', get_template_directory_uri().'/assets/script.js', array('jquery'), '', 1); $disable_sticky_header_option = covernews_get_option('disable_sticky_header_option'); if($disable_sticky_header_option == false ){ wp_enqueue_script('covernews-fixed-header-script', get_template_directory_uri().'/assets/fixed-header-script.js', array('jquery'), '', 1); } if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } } add_action('wp_enqueue_scripts', 'covernews_scripts'); /** * Enqueue admin scripts and styles. * * @since CoverNews 1.0.0 */ function covernews__admin_scripts($hook){ if ('widgets.php' === $hook) { wp_enqueue_media(); wp_enqueue_script('covernews-widgets', get_template_directory_uri() . '/assets/widgets.js', array('jquery'), '1.0.0', true); } } add_action('admin_enqueue_scripts', 'covernews__admin_scripts'); /** * Custom template tags for this theme. */ require get_template_directory().'/inc/template-tags.php'; /** * Custom template tags for this theme. */ require get_template_directory().'/inc/template-images.php'; /** * Functions which enhance the theme by hooking into WordPress. */ require get_template_directory().'/inc/template-functions.php'; /** * Customizer additions. */ require get_template_directory().'/inc/customizer/customizer.php'; /** * Implement the Custom Header feature. */ require get_template_directory().'/inc/custom-header.php'; /** * Customizer additions. */ require get_template_directory().'/inc/init.php'; /** * Customizer additions. */ require get_template_directory().'/inc/ocdi.php'; /** * Load Jetpack compatibility file. */ if (defined('JETPACK__VERSION')) { require get_template_directory().'/inc/jetpack.php'; } /** * Load WooCommerce compatibility file. */ if ( class_exists( 'WooCommerce' ) ) { require get_template_directory() . '/inc/woocommerce.php'; } /** * Descriptions on Header Menu * @author AF themes * @param string $item_output, HTML outputp for the menu item * @param object $item, menu item object * @param int $depth, depth in menu structure * @param object $args, arguments passed to wp_nav_menu() * @return string $item_output */ function covernews_header_menu_desc( $item_output, $item, $depth, $args ) { if( 'aft-primary-nav' == $args->theme_location && $item->description ) $item_output = str_replace( '</a>', '<span class="menu-description">' . $item->description . '</span></a>', $item_output ); return $item_output; } add_filter( 'walker_nav_menu_start_el', 'covernews_header_menu_desc', 10, 4 ); <!doctype html> <html lang="ru-RU"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="profile" href="http://gmpg.org/xfn/11"> <link rel='dns-prefetch' href='//s.w.org' /> <link rel="alternate" type="application/rss+xml" title="DANCE TEAM » Лента комментариев к «»" href="http://gida.am/sample-page/feed/" /> <script type="text/javascript"> window._wpemojiSettings = {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/12.0.0-1\/72x72\/","ext":".png","svgUrl":"https:\/\/s.w.org\/images\/core\/emoji\/12.0.0-1\/svg\/","svgExt":".svg","source":{"concatemoji":"http:\/\/gida.am\/wp-includes\/js\/wp-emoji-release.min.js?ver=5.2.20"}}; !function(e,a,t){var n,r,o,i=a.createElement("canvas"),p=i.getContext&&i.getContext("2d");function s(e,t){var a=String.fromCharCode;p.clearRect(0,0,i.width,i.height),p.fillText(a.apply(this,e),0,0);e=i.toDataURL();return p.clearRect(0,0,i.width,i.height),p.fillText(a.apply(this,t),0,0),e===i.toDataURL()}function c(e){var t=a.createElement("script");t.src=e,t.defer=t.type="text/javascript",a.getElementsByTagName("head")[0].appendChild(t)}for(o=Array("flag","emoji"),t.supports={everything:!0,everythingExceptFlag:!0},r=0;r<o.length;r++)t.supports[o[r]]=function(e){if(!p||!p.fillText)return!1;switch(p.textBaseline="top",p.font="600 32px Arial",e){case"flag":return s([55356,56826,55356,56819],[55356,56826,8203,55356,56819])?!1:!s([55356,57332,56128,56423,56128,56418,56128,56421,56128,56430,56128,56423,56128,56447],[55356,57332,8203,56128,56423,8203,56128,56418,8203,56128,56421,8203,56128,56430,8203,56128,56423,8203,56128,56447]);case"emoji":return!s([55357,56424,55356,57342,8205,55358,56605,8205,55357,56424,55356,57340],[55357,56424,55356,57342,8203,55358,56605,8203,55357,56424,55356,57340])}return!1}(o[r]),t.supports.everything=t.supports.everything&&t.supports[o[r]],"flag"!==o[r]&&(t.supports.everythingExceptFlag=t.supports.everythingExceptFlag&&t.supports[o[r]]);t.supports.everythingExceptFlag=t.supports.everythingExceptFlag&&!t.supports.flag,t.DOMReady=!1,t.readyCallback=function(){t.DOMReady=!0},t.supports.everything||(n=function(){t.readyCallback()},a.addEventListener?(a.addEventListener("DOMContentLoaded",n,!1),e.addEventListener("load",n,!1)):(e.attachEvent("onload",n),a.attachEvent("onreadystatechange",function(){"complete"===a.readyState&&t.readyCallback()})),(n=t.source||{}).concatemoji?c(n.concatemoji):n.wpemoji&&n.twemoji&&(c(n.twemoji),c(n.wpemoji)))}(window,document,window._wpemojiSettings); </script> <style type="text/css"> img.wp-smiley, img.emoji { display: inline !important; border: none !important; box-shadow: none !important; height: 1em !important; width: 1em !important; margin: 0 .07em !important; vertical-align: -0.1em !important; background: none !important; padding: 0 !important; } </style> <link rel='stylesheet' id='wp-block-library-css' href='http://gida.am/wp-includes/css/dist/block-library/style.min.css?ver=5.2.20' type='text/css' media='all' /> <link rel='stylesheet' id='contact-form-7-css' href='http://gida.am/wp-content/plugins/contact-form-7/includes/css/styles.css?ver=5.1.4' type='text/css' media='all' /> <script type='text/javascript' src='http://gida.am/wp-includes/js/jquery/jquery.js?ver=1.12.4-wp'></script> <script type='text/javascript' src='http://gida.am/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1'></script> <link rel='https://api.w.org/' href='http://gida.am/wp-json/' /> <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://gida.am/xmlrpc.php?rsd" /> <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://gida.am/wp-includes/wlwmanifest.xml" /> <meta name="generator" content="WordPress 5.2.20" /> <link rel="canonical" href="http://gida.am/" /> <link rel='shortlink' href='http://gida.am/' /> <link rel="alternate" type="application/json+oembed" href="http://gida.am/wp-json/oembed/1.0/embed?url=http%3A%2F%2Fgida.am%2F" /> <link rel="alternate" type="text/xml+oembed" href="http://gida.am/wp-json/oembed/1.0/embed?url=http%3A%2F%2Fgida.am%2F&format=xml" /> </head> <body class="home page-template-default page page-id-2">