Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- Slider -->
- <div class="main_slider">
- <div class="container_12">
- <div class="grid_12">
- <ul class="slider_container" id="themedrops_slider">
- <?php
- $cat_collect = array();
- $args = array(
- 'type' => 'post',
- 'child_of' => 0,
- 'orderby' => 'name',
- 'order' => 'ASC',
- 'hide_empty' => 0,
- 'hierarchical' => 1,
- 'taxonomy' => 'category',
- 'pad_counts' => false );
- $categories = get_categories( $args );
- $cat_exclude = array();
- foreach ($categories as $category) {
- if(get_option('_slide'.$category->cat_ID))
- {
- $cat_exclude[] = $category->cat_ID;
- }
- }
- $arg = array('posts_per_page' => 5,'category__not_in'=>$cat_exclude);
- $query = new wp_query($arg);
- while($query->have_posts())
- {
- $query->the_post();
- $args = array(
- 'post_type' => 'attachment',
- 'numberposts' => 4,
- 'post_status' => null,
- 'post_parent' => get_the_ID()
- );
- $attachments = get_posts( $args );
- if ( $attachments ) {
- $counter = 0;
- $min=0;
- foreach ( $attachments as $attachment ) {
- $img_full = wp_get_attachment_image_src( $attachment->ID,'image-11');
- if($img_full[1] == 596 || $img_full[1] > 596)
- {
- break;
- }else if($min < $img_full[1])
- {
- $min = $img_full[1];
- }
- else{break;}
- }
- $img = $img_full[0];
- }else if(catch_that_image())
- {
- $img = catch_that_image();
- }
- if($img)
- {?>
- <!-- Slider Items -->
- <li>
- <div class="featured_image">
- <a href="<?php echo $img; ?>" class="overlay view_image">
- <img src="<?php echo $img; ?>" width="605" height="365" alt="blog-post-img" />
- </a>
- </div>
- <div class="featured_text">
- <h1>
- <a href="<?php the_permalink(); ?>">
- <?php
- // short_title($after, $length)
- echo short_title('...', 10);
- ?>
- </a>
- </h1>
- <div class="post_details">
- <div class="author_date">
- Por
- <a href="<?php echo get_author_posts_url(get_the_author_meta( 'ID' )); ?>">
- <?php echo get_the_author(); ?></a>
- em
- <?php $day = get_the_date('d'); $month = get_the_date('m'); $year = get_the_date('Y'); ?>
- <a href="<?php echo get_day_link($year,$month,$day); ?>">
- <?php echo $day ?></a> /
- <a href="<?php echo get_month_link($year,$month); ?>">
- <?php echo $month ?>
- </a> /
- <a href="<?php echo get_year_link($year);?>">
- <?php echo $year ?>
- </a>
- </div>
- <a class="comment_box" href="<?php the_permalink(); ?>"><?php echo get_comments_number(); ?></a>
- </div>
- <div class="post_text">
- <?php
- if ( ! function_exists( 'taduo_exceprt_length' ) ) :
- function taduo_exceprt_length( $length ) {
- return 70;
- }
- endif;
- add_filter( 'excerpt_length', 'taduo_exceprt_length' );
- if ( ! function_exists( 'taduo_exerpt' ) ) :
- function taduo_exerpt($more) {
- return '...';
- }
- endif;
- add_filter('excerpt_more', 'taduo_exerpt');
- the_excerpt();
- remove_filter( 'excerpt_length', 'taduo_exceprt_length' );
- remove_filter('excerpt_more', 'taduo_exerpt');
- ?>
- </div>
- <a href="<?php the_permalink(); ?>" class="btn">
- <span>Leia Mais</span>
- </a>
- </div>
- </li>
- <!-- End of: Slider Item -->
- <?php
- }//Close IF
- }//Close While
- ?>
- </ul>
- <div class="clear"></div>
- <div class="slider_shadow"></div>
- <!-- Slider Buttons -->
- <div class="slider_buttons">
- </div>
- <!-- End of: Slider Buttons -->
- </div>
- </div>
- </div>
- <!-- End of: Slider -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement