Advertisement
darrenbachan

MixItUp

Jun 17th, 2016
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.48 KB | None | 0 0
  1. // content-upcoming-games.php
  2. <div class="controls col-md-12">
  3.    <label>Sort By:</label>
  4.  
  5.    <button class="filter" data-filter="all">All</button>
  6.    <button class="filter" data-filter=".ps4">PS4</button>
  7.    <button class="filter" data-filter=".xbox-one">Xbox One</button>
  8.    <button class="filter" data-filter=".wii-u">Wii U</button>
  9.    <button class="filter" data-filter=".pc">PC</button>
  10. </div>
  11.  
  12. <?php if(is_post_type_archive( 'upcoming-games' )) {
  13.    $class ='';
  14.    $consoles_slug = wp_get_object_terms( $post->ID,  'consoles' );
  15.    foreach ($consoles_slug as $console_slug) {
  16.    $class .= $console_slug->slug . ' ';
  17.    } }
  18. ?>
  19.  
  20. <div id="upcoming-games-list">
  21.    <div class="mix <?php echo $class ?> ?>">
  22.       Content
  23.    </div>
  24. </div>
  25.  
  26. --------------------------------------------------------------------------------------------------------
  27.  
  28. // main.js
  29.     $('#upcoming-games-list').mixItUp({
  30.         animation: {
  31.         enable: true,
  32.         effects: 'fade scale',
  33.         duration: 600,
  34.         easing: 'ease',
  35.         perspectiveDistance: '3000px',
  36.         perspectiveOrigin: '50% 50%',
  37.         queue: true,
  38.         queueLimit: 1,
  39.         animateChangeLayout: false,
  40.         animateResizeContainer: true,
  41.         animateResizeTargets: false,
  42.         staggerSequence: null,
  43.         reverseOut: false
  44.         }
  45.     });
  46.  
  47. --------------------------------------------------------------------------------------------------------
  48.  
  49. // functions.php
  50. wp_enqueue_script( 'console-filtering', get_template_directory_uri() . "/js/jquery.mixitup.js", array(), '' , true );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement