Exemplo n.º 1
0
function mts_add_scripts()
{
    $mts_options = get_option(MTS_THEME_NAME);
    wp_enqueue_script('jquery');
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    wp_register_script('customscript', get_template_directory_uri() . '/js/customscript.js', true);
    if (!empty($mts_options['mts_show_primary_nav'])) {
        $nav_menu = 'primary';
    } else {
        $nav_menu = 'none';
    }
    wp_localize_script('customscript', 'mts_customscript', array('responsive' => empty($mts_options['mts_responsive']) ? false : true, 'nav_menu' => $nav_menu));
    wp_enqueue_script('customscript');
    // Slider
    wp_register_script('owl-carousel', get_template_directory_uri() . '/js/owl.carousel.min.js');
    if (!empty($mts_options['mts_header_slider']) || !empty($mts_options['mts_featured_slider'])) {
        wp_enqueue_script('owl-carousel');
    }
    // Animated single post/page header
    if (is_singular()) {
        $header_animation = mts_get_post_header_effect();
        if ('parallax' == $header_animation) {
            wp_register_script('jquery-parallax', get_template_directory_uri() . '/js/parallax.js');
            wp_enqueue_script('jquery-parallax');
        } else {
            if ('zoomout' == $header_animation) {
                wp_register_script('jquery-zoomout', get_template_directory_uri() . '/js/zoomout.js');
                wp_enqueue_script('jquery-zoomout');
            }
        }
    }
    global $is_IE;
    if ($is_IE) {
        wp_register_script('html5shim', "http://html5shim.googlecode.com/svn/trunk/html5.js");
        wp_enqueue_script('html5shim');
    }
}
Exemplo n.º 2
0
<?php

$mts_options = get_option(MTS_THEME_NAME);
get_header();
?>
<div id="page" class="<?php 
mts_single_page_class();
?>
">
	<?php 
$header_animation = mts_get_post_header_effect();
?>
	<?php 
if ('parallax' === $header_animation) {
    ?>
		<?php 
    if (mts_get_thumbnail_url()) {
        ?>
	        <div id="parallax" <?php 
        echo 'style="background-image: url(' . mts_get_thumbnail_url() . ');"';
        ?>
></div>
	    <?php 
    }
    ?>
	<?php 
} else {
    if ('zoomout' === $header_animation) {
        ?>
		 <?php 
        if (mts_get_thumbnail_url()) {
Exemplo n.º 3
0
 function mts_single_page_class()
 {
     $class = '';
     if (is_single() || is_page()) {
         $class = 'single';
         $header_animation = mts_get_post_header_effect();
         if (!empty($header_animation)) {
             $class .= ' ' . $header_animation;
         }
     }
     echo $class;
 }