dangermoose

slider-actions.php

Mar 27th, 2012
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.05 KB | None | 0 0
  1. <?php
  2. /**
  3. * Slider actions used by the CyberChimps Response Core Framework
  4. *
  5. * Author: Tyler Cunningham
  6. * Copyright: © 2011
  7. * {@link http://cyberchimps.com/ CyberChimps LLC}
  8. *
  9. * Released under the terms of the GNU General Public License.
  10. * You should have received a copy of the GNU General Public License,
  11. * along with this software. In the main directory, see: /licensing/
  12. * If not, see: {@link http://www.gnu.org/licenses/}.
  13. *
  14. * @package Response
  15. * @since 1.0
  16. */
  17.  
  18. /**
  19. * Response slider actions
  20. */
  21.  
  22. add_action ('response_blog_slider', 'response_slider_lite_content' );
  23. add_action ('response_page_slider', 'response_slider_lite_content' );
  24. add_action ('response_home_slider', 'response_slider_lite_content' );
  25.  
  26.  
  27. /**
  28. * Lite slider function
  29. */
  30. function response_slider_lite_content() {
  31.  
  32.     global $themename, $themeslug, $options, $wp_query, $post, $slider_default, $root;
  33.        
  34.     if (is_page()) {
  35.         $slide1 = get_post_meta($post->ID, 'page_slide_one_image' , true);
  36.         $slide2 = get_post_meta($post->ID, 'page_slide_two_image' , true);
  37.         $slide3 = get_post_meta($post->ID, 'page_slide_three_image' , true);
  38.    
  39.         $link1 = get_post_meta($post->ID, 'page_slide_one_url' , true);
  40.         $link2 = get_post_meta($post->ID, 'page_slide_two_url' , true);
  41.         $link3 = get_post_meta($post->ID, 'page_slide_three_url' , true);
  42.     }
  43.     /*elseif (is_front_page()) {*/
  44.     elseif (is_page('home')) {
  45.         $slide1source = $options->get($themeslug.'_home_slide_one_image');
  46.         $slide2source = $options->get($themeslug.'_home_slide_two_image');
  47.         $slide3source = $options->get($themeslug.'_home_slide_three_image');
  48.        
  49.         $slide1 = $slide1source['url'];
  50.         $slide2 = $slide2source['url'];
  51.         $slide3 = $slide3source['url'];
  52.    
  53.         $link1 = $options->get($themeslug.'_home_slide_one_url');
  54.         $link2 = $options->get($themeslug.'_home_slide_two_url');
  55.         $link3 = $options->get($themeslug.'_home_slide_three_url');
  56.  
  57.     }
  58.    
  59.     else {
  60.         $slide1source = $options->get($themeslug.'_blog_slide_one_image');
  61.         $slide2source = $options->get($themeslug.'_blog_slide_two_image');
  62.         $slide3source = $options->get($themeslug.'_blog_slide_three_image');
  63.        
  64.         $slide1 = $slide1source['url'];
  65.         $slide2 = $slide2source['url'];
  66.         $slide3 = $slide3source['url'];
  67.    
  68.         $link1 = $options->get($themeslug.'_blog_slide_one_url');
  69.         $link2 = $options->get($themeslug.'_blog_slide_two_url');
  70.         $link3 = $options->get($themeslug.'_blog_slide_three_url');
  71.  
  72.     }
  73.  
  74. ?>
  75.     <div class="row">
  76.         <div id="orbitDemo">
  77.             <a href="<?php echo $link1; ?>">
  78.                 <img src="<?php echo $slide1 ;?>" alt="Slider" />
  79.             </a>
  80.             <a href="<?php echo $link2; ?>">
  81.                 <img src="<?php echo $slide2 ;?>" alt="Slider" />
  82.             </a>
  83.             <a href="<?php echo $link3; ?>">
  84.                 <img src="<?php echo $slide3 ;?>" alt="Slider" />
  85.             </a>
  86.         </div>
  87.     </div>
  88.  
  89. <script type="text/javascript">
  90.     jQuery(document).ready(function ($) {
  91.     $(window).load(function() {
  92.     $('#orbitDemo').orbit({
  93.          animation: 'horizontal-push',
  94.          bullets: true,
  95.      });
  96.      });
  97.      });
  98. </script>
  99.  
  100. <?php
  101.  
  102. }
  103.  
  104. /**
  105. * End
  106. */
  107.  
  108. ?>
Advertisement
Add Comment
Please, Sign In to add comment