Exemple #1
0
function reef_scripts()
{
    // clear head
    remove_action('wp_head', 'wp_generator');
    remove_action('wp_head', 'wlwmanifest_link');
    remove_action('wp_head', 'rsd_link');
    remove_action('wp_head', 'wp_shortlink_wp_head');
    remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10);
    add_filter('the_generator', '__return_false');
    remove_action('wp_head', 'print_emoji_detection_script', 7);
    remove_action('wp_print_styles', 'print_emoji_styles');
    remove_action('wp_head', 'feed_links_extra', 3);
    remove_action('set_comment_cookies', 'wp_set_comment_cookies');
    // load desktop stylesheet.
    wp_register_style('reef-desk-style', REEF_THEME_URL . 'assets/css/style.desk.min.css');
    //load mobile stylesheet
    wp_register_style('reef-mob-style', REEF_THEME_URL . 'assets/css/style.mob.min.css');
    // load scripts
    //    wp_deregister_script('jquery');
    wp_register_script('main-desk', REEF_THEME_URL . '/assets/js/main.js', array(), '2.0', true);
    wp_register_script('main-mob', REEF_THEME_URL . '/assets/js/main.mob.js', array(), '2.0', true);
    wp_register_script('backgroundvideo', REEF_THEME_URL . '/assets/js/jquery.backgroundvideo.min.js', array(), '1.0', true);
    if (reef_mobile_detect()) {
        wp_enqueue_style('reef-mob-style');
        wp_enqueue_script('main-mob');
        wp_localize_script('main-mob', 'REEFmobile', array('reef_nonce' => wp_create_nonce('reef_nonce'), 'ajax_url' => admin_url('admin-ajax.php')));
    } else {
        wp_enqueue_style('reef-desk-style');
        wp_enqueue_script('main-desk');
        wp_enqueue_script('backgroundvideo');
        wp_localize_script('main-desk', 'REEFmain', array('themeURL' => REEF_THEME_URL, 'reef_nonce' => wp_create_nonce('reef_nonce'), 'ajax_url' => admin_url('admin-ajax.php')));
    }
}
Exemple #2
0
<?php

get_header();
?>



<?php 
if (reef_mobile_detect()) {
    get_template_part('mob_ru');
} else {
    ?>

	<?php 
    get_template_part('parts/preloader');
    ?>

	<div id="main-wrapper">

	<div class="container">

	<header>
		<div id="topline" class="topline">
			<div class="topline-nav">
				<div class="topline-nav_container clearfix">

					<?php 
    get_template_part('parts/logo');
    ?>

					<nav class="nav-bar">