Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: Home
- */
- get_header(); ?>
- <!-- carousel css/js code -->
- <style type="text/css">
- /* Circular Content Carousel Style */
- .ca-container{
- position:relative;
- margin:25px auto 20px auto;
- width:990px;
- height:450px;
- }
- .ca-wrapper{
- width:100%;
- height:100%;
- position:relative;
- }
- .ca-item{
- position:relative;
- float:left;
- width:330px;
- height:100%;
- text-align:center;
- }
- .ca-more{
- position: absolute;
- bottom: 10px;
- right:0px;
- padding:4px 15px;
- font-weight:bold;
- background: #ccbda2;
- text-align:center;
- color: white;
- font-family: "Georgia","Times New Roman",serif;
- font-style:italic;
- text-shadow:1px 1px 1px #897c63;
- }
- .ca-close{
- position:absolute;
- top:10px;
- right:10px;
- background:#fff url(../images/cross.png) no-repeat center center;
- width:27px;
- height:27px;
- text-indent:-9000px;
- outline:none;
- -moz-box-shadow:1px 1px 2px rgba(0,0,0,0.2);
- -webkit-box-shadow:1px 1px 2px rgba(0,0,0,0.2);
- box-shadow:1px 1px 2px rgba(0,0,0,0.2);
- opacity:0.7;
- }
- .ca-close:hover{
- opacity:1.0;
- }
- .ca-item-main{
- padding:20px;
- position:absolute;
- top:5px;
- left:5px;
- right:5px;
- bottom:5px;
- background:#fff;
- overflow:hidden;
- -moz-box-shadow:1px 1px 2px rgba(0,0,0,0.2);
- -webkit-box-shadow:1px 1px 2px rgba(0,0,0,0.2);
- box-shadow:1px 1px 2px rgba(0,0,0,0.2);
- }
- .ca-icon{
- width:233px;
- height:189px;
- position:relative;
- margin:0 auto;
- background:transparent url(../images/animal1.png) no-repeat center center;
- }
- .ca-item-2 .ca-icon{
- background-image:url(../images/animal2.png);
- }
- .ca-item h3{
- font-family: 'Coustard', sans-serif;
- text-transform:uppercase;
- font-size:30px;
- color:#000;
- margin-bottom:10px;
- text-align:center;
- text-shadow: 0px 1px 1px #e4ebe9;
- }
- .ca-item h4{
- font-family: "Georgia","Times New Roman",serif;
- font-style:italic;
- font-size:12px;
- text-align:left;
- border-left:10px solid #b0ccc6;
- padding-left:10px;
- line-height:24px;
- margin:10px;
- position:relative;
- }
- .ca-item h4 span{
- text-indent:40px;
- display:block;
- }
- .ca-item h4 span.ca-quote{
- color:#f4eee3;
- font-size:100px;
- position:absolute;
- top:20px;
- left:0px;
- text-indent:0px;
- }
- .ca-content-wrapper{
- background:#b0ccc6;
- position:absolute;
- width:0px; /* expands to width of the wrapper minus 1 element */
- height:440px;
- top:5px;
- text-align:left;
- z-index:10000;
- overflow:hidden;
- }
- .ca-content{
- width:660px;
- border-bottom: 1px solid #f2f2f2;
- text-align: center;
- overflow:hidden;
- }
- .ca-content-text{
- font-size: 14px;
- font-style: italic;
- font-family: "Georgia","Times New Roman",serif;
- margin:10px 20px;
- padding:10px 20px;
- line-height:24px;
- }
- .ca-content-text p{
- padding-bottom:5px;
- }
- .ca-content h6{
- margin:25px 20px 0px 35px;
- font-size:32px;
- padding-bottom:5px;
- color:#000;
- font-family: 'Coustard', sans-serif;
- color:#60817a;
- border-bottom:2px solid #99bcb4;
- text-shadow: 1px 1px 1px #99BCB4;
- }
- .ca-content ul{
- margin:20px 35px;
- height:30px;
- }
- .ca-content ul li{
- float:left;
- margin:0px 2px;
- }
- .ca-content ul li a{
- color:#fff;
- background:#000;
- padding:3px 6px;
- font-size:14px;
- font-family: "Georgia","Times New Roman",serif;
- font-style:italic;
- }
- .ca-content ul li a:hover{
- background:#fff;
- color:#000;
- text-shadow:none;
- }
- .ca-nav span{
- width:25px;
- height:38px;
- background:transparent url(../images/arrows.png) no-repeat top left;
- position:absolute;
- top:50%;
- margin-top:-19px;
- left:-40px;
- text-indent:-9000px;
- opacity:0.7;
- cursor:pointer;
- z-index:100;
- }
- .ca-nav span.ca-nav-next{
- background-position:top right;
- left:auto;
- right:-40px;
- }
- .ca-nav span:hover{
- opacity:1.0;
- }
- </style>
- <script type="text/javascript">
- (function(e){var t={navigate:function(t,n,r,i,s){var o=i.scroll,u=1,a=0;if(s.expanded){o=1;u=3;a=s.idxClicked}if(t===1){r.find("div.ca-item:lt("+o+")").each(function(t){e(this).clone(true).css("left",(s.totalItems-a+t)*s.itemW*u+"px").appendTo(r)})}else{var f=r.children().eq(0);r.find("div.ca-item:gt("+(s.totalItems-1-o)+")").each(function(t){e(this).clone(true).css("left",-(o-t+a)*s.itemW*u+"px").insertBefore(f)})}r.find("div.ca-item").each(function(n){var r=e(this);r.stop().animate({left:t===1?"-="+s.itemW*u*o+"px":"+="+s.itemW*u*o+"px"},i.sliderSpeed,i.sliderEasing,function(){if(t===1&&r.position().left<-a*s.itemW*u||t===-1&&r.position().left>(s.totalItems-1-a)*s.itemW*u){r.remove()}s.isAnimating=false})})},openItem:function(e,n,r,i){i.idxClicked=n.index();i.winpos=t.getWinPos(n.position().left,i);e.find("div.ca-item").not(n).hide();n.find("div.ca-content-wrapper").css("left",i.itemW+"px").stop().animate({width:i.itemW*2+"px",left:i.itemW+"px"},r.itemSpeed,r.itemEasing).end().stop().animate({left:"0px"},r.itemSpeed,r.itemEasing,function(){i.isAnimating=false;i.expanded=true;t.openItems(e,n,r,i)})},openItems:function(n,r,i,s){var o=r.index();n.find("div.ca-item").each(function(n){var r=e(this),i=r.index();if(i!==o){r.css("left",-(o-i)*s.itemW*3+"px").show().find("div.ca-content-wrapper").css({left:s.itemW+"px",width:s.itemW*2+"px"});t.toggleMore(r,false)}})},toggleMore:function(e,t){t?e.find("a.ca-more").show():e.find("a.ca-more").hide()},closeItems:function(n,r,i,s){var o=r.index();r.find("div.ca-content-wrapper").stop().animate({width:"0px"},i.itemSpeed,i.itemEasing).end().stop().animate({left:s.itemW*(s.winpos-1)+"px"},i.itemSpeed,i.itemEasing,function(){s.isAnimating=false;s.expanded=false});t.toggleMore(r,true);n.find("div.ca-item").each(function(n){var r=e(this),i=r.index();if(i!==o){r.find("div.ca-content-wrapper").css({width:"0px"}).end().css("left",(s.winpos-1-(o-i))*s.itemW+"px").show();t.toggleMore(r,true)}})},getWinPos:function(e,t){switch(e){case 0:return 1;break;case t.itemW:return 2;break;case t.itemW*2:return 3;break}}},n={init:function(n){if(this.length){var r={sliderSpeed:500,sliderEasing:"easeOutExpo",itemSpeed:500,itemEasing:"easeOutExpo",scroll:1};return this.each(function(){if(n){e.extend(r,n)}var i=e(this),s=i.find("div.ca-wrapper"),o=s.children("div.ca-item"),u={};u.itemW=o.width();u.totalItems=o.length;if(u.totalItems>3)i.prepend('<div class="ca-nav"><span class="ca-nav-prev">Previous</span><span class="ca-nav-next">Next</span></div>');if(r.scroll<1)r.scroll=1;else if(r.scroll>3)r.scroll=3;var a=i.find("span.ca-nav-prev"),f=i.find("span.ca-nav-next");s.css("overflow","hidden");o.each(function(t){e(this).css({position:"absolute",left:t*u.itemW+"px"})});i.find("a.ca-more").live("click.contentcarousel",function(n){if(u.isAnimating)return false;u.isAnimating=true;e(this).hide();var i=e(this).closest("div.ca-item");t.openItem(s,i,r,u);return false});i.find("a.ca-close").live("click.contentcarousel",function(n){if(u.isAnimating)return false;u.isAnimating=true;var i=e(this).closest("div.ca-item");t.closeItems(s,i,r,u);return false});a.bind("click.contentcarousel",function(e){if(u.isAnimating)return false;u.isAnimating=true;t.navigate(-1,i,s,r,u)});f.bind("click.contentcarousel",function(e){if(u.isAnimating)return false;u.isAnimating=true;t.navigate(1,i,s,r,u)});i.bind("mousewheel.contentcarousel",function(e,n){if(n>0){if(u.isAnimating)return false;u.isAnimating=true;t.navigate(-1,i,s,r,u)}else{if(u.isAnimating)return false;u.isAnimating=true;t.navigate(1,i,s,r,u)}return false})})}}};e.fn.contentcarousel=function(t){if(n[t]){return n[t].apply(this,Array.prototype.slice.call(arguments,1))}else if(typeof t==="object"||!t){return n.init.apply(this,arguments)}else{e.error("Method "+t+" does not exist on jQuery.contentcarousel")}}})(jQuery);(function(e){function n(t){var n=t||window.event,r=[].slice.call(arguments,1),i=0,s=true,o=0,u=0;t=e.event.fix(n);t.type="mousewheel";if(t.wheelDelta){i=t.wheelDelta/120}if(t.detail){i=-t.detail/3}u=i;if(n.axis!==undefined&&n.axis===n.HORIZONTAL_AXIS){u=0;o=-1*i}if(n.wheelDeltaY!==undefined){u=n.wheelDeltaY/120}if(n.wheelDeltaX!==undefined){o=-1*n.wheelDeltaX/120}r.unshift(t,i,o,u);return e.event.handle.apply(this,r)}var t=["DOMMouseScroll","mousewheel"];e.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var e=t.length;e;){this.addEventListener(t[--e],n,false)}}else{this.onmousewheel=n}},teardown:function(){if(this.removeEventListener){for(var e=t.length;e;){this.removeEventListener(t[--e],n,false)}}else{this.onmousewheel=null}}};e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})})(jQuery)
- jQuery(document).ready(function(){
- jQuery('#ca-container').contentcarousel();
- });
- </script>
- <!-- end carousel css/js code -->
- <div class="royalSlider rsDefaultInv visibleNearbySimple rsHor rsWebkit3d">
- <?php
- global $post;
- $all_events = tribe_get_events(
- array(
- 'posts_per_page'=>3,
- 'tax_query'=> array(
- array(
- 'taxonomy' => 'tribe_events_cat',
- 'field' => 'slug',
- 'terms' => 'featured'
- )
- )
- )
- );
- foreach($all_events as $post) {
- setup_postdata($post);
- ?>
- <?php $terms = get_the_terms( $post->ID, 'tribe_events_cat' ); ?>
- <div class="<?php foreach( $terms as $term ) echo ' ' . $term->slug; ?>">
- <?php
- $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'large' );
- if ($image) : ?>
- <img class="rsImg" src="<?php echo $image[0]; ?>" alt="" />
- <?php endif; ?>
- <div class="rsABlock clearfix">
- <div class="slider-title">
- <h3><a href="<?php the_permalink();?>"><?php the_title();?></a></h3>
- <h4><meta itemprop="startDate" content="<?php echo tribe_get_start_date( null, false, 'Y-m-d-h:i:s' ); ?>"/><?php echo tribe_get_start_date(); ?></h4>
- </div>
- <div class="slider-excerpt">
- <p><?php the_excerpt();?></p>
- <a href="<?php the_permalink();?>">Read more…</a>
- </div>
- </div>
- </div>
- <?php
- } //endforeach
- ?>
- <?php wp_reset_query(); ?>
- </div>
- <div id="page">
- <section>
- <div id="ca-container" class="ca-container" style="overflow: hidden;">
- <div class="ca-wrapper">
- <?php
- global $post;
- $current_date = date('j M Y');
- /* get upcoming 30 day event, you can edit this to less day */
- $end_date = date('j M Y', strtotime('30 days'));
- $terms = get_terms( 'tribe_events_cat', 'hide_empty=0' );
- $i = 1;
- foreach($terms as $tribe_category){
- echo '<div class="ca-item ca-item-'.$i.'">'; $i++;
- /* Featured Event */
- $all_events_one = tribe_get_events(
- array(
- 'post_type' => 'tribe_events',
- 'start_date' => $current_date,
- 'end_date' => $end_date,
- 'eventDisplay' => 'upcoming',
- 'posts_per_page'=> 1,
- 'tax_query'=> array(
- array(
- 'taxonomy' => 'tribe_events_cat',
- 'field' => 'slug',
- 'terms' => $tribe_category
- )
- )
- )
- );
- /* Sub Event */
- $all_events_two = tribe_get_events(
- array(
- 'post_type' => 'tribe_events',
- 'start_date' => $current_date,
- 'end_date' => $end_date,
- 'eventDisplay' => 'upcoming',
- 'posts_per_page'=> 3,
- 'offset' => 1,
- 'tax_query'=> array(
- array(
- 'taxonomy' => 'tribe_events_cat',
- 'field' => 'slug',
- 'terms' => $tribe_category
- )
- )
- )
- );
- foreach($all_events_one as $post) {
- setup_postdata($post);
- ?>
- <div class="ca-item-main">
- <h3><?php the_title(); ?></h3>
- <span class="event-date"><a href="<?php the_permalink(); ?>"><?php echo tribe_get_start_date($post->ID, true, 'M j, Y'); ?></a></span>
- <?php if ( has_post_thumbnail() ) { ?>
- <div class="event-thumb">
- <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumbnail'); ?></a>
- </div>
- <div class="event-excerpt">
- <?php the_excerpt(); ?>
- </div>
- <?php } else { ?>
- <div class="event-content">
- <?php the_content(); ?>
- </div>
- <?php } ?>
- <a href="#" class="ca-more" style="display: block;">more...</a>
- </div>
- <?php
- } //endforeach
- wp_reset_query(); ?>
- <!-- start sub-event -->
- <div class="ca-content-wrapper">
- <?php
- foreach($all_events_two as $post) {
- setup_postdata($post);
- ?>
- <div class="ca-content">
- <h3><?php the_title(); ?></h3>
- <?php the_excerpt(); ?>
- </div>
- <?php
- } // end foreach
- wp_reset_query(); ?>
- <!-- end sub-event -->
- <a href="#" class="ca-close">close</a>
- </div>
- <?php
- echo '</div>'; // end div.ca-item
- } // end foreach($terms as $tribe_category)
- ?>
- </div>
- <!-- ca-wrapper -->
- </div>
- <!-- ca-container -->
- </section>
- <section class="clearfix">
- <div class="quater-column left">
- <?php if ( ! dynamic_sidebar( 'homepage-left-widgets' ) ) : ?>
- <?php endif; // end homepage widget area ?>
- </div>
- <div class="half-column left">
- <?php get_template_part('calendar'); ?>
- </div>
- <div class="quarter-column right">
- <?php if ( ! dynamic_sidebar( 'homepage-right-widgets' ) ) : ?>
- <?php endif; // end homepage widget area ?>
- </div>
- </section>
- </div>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement