Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php get_header(); ?>
- <div id="container">
- <?php
- $paged = 0;
- if(isset($_GET['paged'])){
- $paged = intval($_GET['paged']);
- }
- $i=0;
- $loop = new WP_Query();
- $loop->query('cat=-44&paged='.$paged);
- if($loop->have_posts()) :
- while($loop->have_posts()) :
- $loop->the_post();
- $i++;
- $the_tags = get_the_tags();
- $tags = null;
- $a=0;
- foreach($the_tags as $tag){
- if($a<4){
- $tags[] = '<a href="?tag='.$tag->term_id.'">'.$tag->name.'</a>';
- $a++;
- } else {
- break;
- }
- }
- ?>
- <div class="post-item">
- <div class="post-title"><h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1></div>
- <?php
- $args = array( 'post_type' => 'attachment', 'post_parent' => get_the_ID() );
- $attachments = get_posts($args);
- $float = 'no';
- if ($attachments) {
- $gambar = wp_get_attachment_image_src( $attachments[0]->ID, '', false);
- if($gambar[1] < 250){
- $float = 'yes';
- } else {
- $float = 'no';
- }
- $showgambar = 'yes';
- } else {
- $showgambar = 'no';
- }
- ?>
- <div class="post-content" <?php
- if($float=='yes'){
- $widthremain = 564 - $gambar[1]; ?>
- style="width: <?php echo $widthremain ?>px;"
- <?php };
- ?>>
- <?php the_excerpt(); ?>
- </div>
- <?php if($showgambar=='yes'){?>
- <div class="post-thumbnail" <?php
- if($float=='no'){
- $widthremain = 564 - $gambar[1]; ?>
- style="width: 100%; text-align: center;"
- <?php };
- ?>>
- <img src="<?php echo $gambar[0]?>" />
- </div>
- <?php } ?>
- <div class="clear"></div>
- <div class="post-meta">Por <?php the_author_posts_link(); ?> - <?php the_time('m F, Y'); ?></div>
- <div class="clear"></div>
- <div class="post-meta-2">
- <div class="post-tag">Etiquetas: <?=implode(', ',$tags);?> <br/> </div>
- <div class="toggle-link"><a href="#" class="compartir<?php echo $i; ?>">Compartir</a></div>
- <div class="clear"></div>
- </div>
- <div class="toggle-content-compartir<?php echo $i; ?>">
- <?php if(function_exists('kc_add_social_share')) kc_add_social_share(); ?>
- </div>
- <div class="post-comment"></div>
- </div>
- <?php endwhile; ?>
- <?php
- $count_posts = wp_count_posts();
- $published_posts = $count_posts->publish;
- ?>
- <div class="navigation-post">
- <div class="next-page"><?php next_posts_link(' ','') ?></div>
- <div class="prev-page"><?php previous_posts_link(' ') ?></div>
- <div class="counter"><?php echo $i; ?> de <?php echo $published_posts; ?> Posts</div>
- <div class="clear"></div>
- </div>
- <?php else: ?>
- <p>Sorry, no posts matched your criteria.</p>
- <?php endif;?>
- </div>
- <?php get_sidebar(); ?>
- </div></div>
- </div>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment