Guest User

Untitled

a guest
Aug 28th, 2015
104
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function sydney_slider_template() {
  2.  
  3.     if ( (get_theme_mod('front_header_type','slider') == 'slider' && is_front_page()) || (get_theme_mod('site_header_type') == 'slider' && !is_front_page()) ) {
  4.  
  5.     //Get the slider options
  6.     $speed      = get_theme_mod('slider_speed', '4000');
  7.     $text_speed = get_theme_mod('textslider_speed', '4000');
  8.     $text_slide = get_theme_mod('textslider_slide', 0);
  9.     if (!$text_slide) {
  10.         $slide_toggle = true;
  11.     } else {
  12.         $slide_toggle = false;
  13.     }
  14.  
  15.     //Slider text
  16.     if ( !function_exists('pll_register_string') ) {
  17.         $slider_title_1     = get_theme_mod('slider_title_1', 'Welcome to Sydney');
  18.         $slider_title_2     = get_theme_mod('slider_title_2', 'Ready to begin your journey?');
  19.         $slider_title_3     = get_theme_mod('slider_title_3');
  20.         $slider_title_4     = get_theme_mod('slider_title_4');
  21.         $slider_title_5     = get_theme_mod('slider_title_5');
  22.         $slider_subtitle_1  = get_theme_mod('slider_subtitle_1','Feel free to look around');
  23.         $slider_subtitle_2  = get_theme_mod('slider_subtitle_2', 'Click the button below');
  24.         $slider_subtitle_3  = get_theme_mod('slider_subtitle_3');
  25.         $slider_subtitle_4  = get_theme_mod('slider_subtitle_4');
  26.         $slider_subtitle_5  = get_theme_mod('slider_subtitle_5');
  27.         $slider_button      = get_theme_mod('slider_button_text', 'Click to begin');
  28.         $slider_button_url  = get_theme_mod('slider_button_url','#primary');        
  29.     } else {
  30.         $slider_title_1     = pll__(get_theme_mod('slider_title_1', 'Welcome to Sydney'));
  31.         $slider_title_2     = pll__(get_theme_mod('slider_title_2', 'Ready to begin your journey?'));
  32.         $slider_title_3     = pll__(get_theme_mod('slider_title_3'));
  33.         $slider_title_4     = pll__(get_theme_mod('slider_title_4'));
  34.         $slider_title_5     = pll__(get_theme_mod('slider_title_5'));
  35.         $slider_subtitle_1  = pll__(get_theme_mod('slider_subtitle_1','Feel free to look around'));
  36.         $slider_subtitle_2  = pll__(get_theme_mod('slider_subtitle_2', 'Click the button below'));
  37.         $slider_subtitle_3  = pll__(get_theme_mod('slider_subtitle_3'));
  38.         $slider_subtitle_4  = pll__(get_theme_mod('slider_subtitle_4'));
  39.         $slider_subtitle_5  = pll__(get_theme_mod('slider_subtitle_5'));  
  40.         $slider_button      = pll__(get_theme_mod('slider_button_text', 'Click to begin'));
  41.         $slider_button_url  = pll__(get_theme_mod('slider_button_url','#primary'));
  42.     }    
  43.     ?>
  44.  
  45.     <div id="slideshow" class="header-slider" data-speed="<?php echo esc_attr($speed); ?>">
  46.         <div class="slides-container">
  47.             <?php
  48.                 if ( get_theme_mod('slider_image_1', get_template_directory_uri() . '/images/1.png') ) {
  49.                     echo '<div class="slide-item" style="background-image:url(' . esc_url(get_theme_mod('slider_image_1', get_template_directory_uri() . '/images/1.jpg')) . ');"></div>';
  50.                
  51.                 }
  52.                 if ( get_theme_mod('slider_image_2', get_template_directory_uri() . '/images/2.jpg') ) {
  53.                     echo '<div class="slide-item" style="background-image:url(' . esc_url(get_theme_mod('slider_image_2', get_template_directory_uri() . '/images/2.jpg')) . ');"></div>';
  54.                 }          
  55.                 if ( get_theme_mod('slider_image_3') ) {
  56.                     echo '<div class="slide-item" style="background-image:url(' . esc_url(get_theme_mod('slider_image_3')) . ');"></div>';
  57.                 }
  58.                 if ( get_theme_mod('slider_image_4') ) {
  59.                     echo '<div class="slide-item" style="background-image:url(' . esc_url(get_theme_mod('slider_image_4')) . ');"></div>';
  60.                 }
  61.                 if ( get_theme_mod('slider_image_5') ) {
  62.                     echo '<div class="slide-item" style="background-image:url(' . esc_url(get_theme_mod('slider_image_5')) . ');"></div>';
  63.                 }              
  64.             ?> 
  65.         </div>
  66.  
  67.         <div class="text-slider-section">
  68.             <div class="text-slider" data-speed="<?php echo esc_attr($text_speed); ?>" data-slideshow="<?php echo esc_attr($slide_toggle); ?>">
  69.                 <ul class="slide-text slides">
  70.                     <?php if ( get_theme_mod('slider_image_1', get_template_directory_uri() . '/images/1.png') ) : ?>
  71.                     <li>
  72.                         <div class="contain">
  73.                             <h2 class="maintitle"><?php echo esc_html($slider_title_1); ?></h2>
  74.                             <p class="subtitle"><?php echo esc_html($slider_subtitle_1); ?></p>
  75.                         </div>
  76.                     </li>
  77.                     <?php endif; ?>
  78.                     <?php if ( get_theme_mod('slider_image_2', get_template_directory_uri() . '/images/2.jpg') ) : ?>
  79.                     <li>
  80.                         <div class="contain">
  81.                             <h2 class="maintitle"><?php echo esc_html($slider_title_2); ?></h2>
  82.                             <p class="subtitle"><?php echo esc_html($slider_subtitle_2); ?></p>
  83.                         </div>
  84.                     </li>
  85.                     <?php endif; ?>
  86.                     <?php if ( get_theme_mod('slider_image_3') ) : ?>
  87.                     <li>
  88.                         <div class="contain">
  89.                             <h2 class="maintitle"><?php echo esc_html($slider_title_3); ?></h2>
  90.                             <p class="subtitle"><?php echo esc_html($slider_subtitle_3); ?></p>
  91.                         </div>
  92.                     </li>
  93.                     <?php endif; ?>
  94.                     <?php if ( get_theme_mod('slider_image_4') ) : ?>
  95.                     <li>
  96.                         <div class="contain">
  97.                             <h2 class="maintitle"><?php echo esc_html($slider_title_4); ?></h2>
  98.                             <p class="subtitle"><?php echo esc_html($slider_subtitle_4); ?></p>
  99.                         </div>
  100.                     </li>
  101.                     <?php endif; ?>
  102.                     <?php if ( get_theme_mod('slider_image_5') ) : ?>
  103.                     <li>
  104.                         <div class="contain">
  105.                             <h2 class="maintitle"><?php echo esc_html($slider_title_5); ?></h2>
  106.                             <p class="subtitle"><?php echo esc_html($slider_subtitle_5); ?></p>
  107.                         </div>
  108.                     </li>
  109.                     <?php endif; ?>                                        
  110.                 </ul>
  111.             </div>
  112.             <?php if ($slider_button) : ?>
  113.                 <a href="<?php echo esc_url($slider_button_url); ?>" class="roll-button button-slider"><?php echo esc_html($slider_button); ?></a>
  114.             <?php endif; ?>
  115.         </div>    
  116.     </div>
  117.     <?php
  118.     } elseif ( (get_theme_mod('front_header_type','slider') == 'revolution' && is_front_page()) || (get_theme_mod('site_header_type') == 'revolution' && !is_front_page()) ) {
  119.       if ( wp_is_mobile() ) :
  120.          putRevSlider("youraliasformobile");
  121.       else :
  122.          putRevSlider("youraliasfordesktop");
  123.       endif;
  124.     }
  125. }
RAW Paste Data