Beispiel #1
0
							<li class="frontpage-cat-first">
								<div class="thumbnail">
									<a href="<?php 
                the_permalink();
                ?>
">
										<img src="<?php 
                bloginfo('template_directory');
                ?>
/scripts/timthumb.php?src=<?php 
                echo get_custom_thumbnail($post);
                ?>
&w=170&h=120&zc=1&q=100">
									</a>
									<div class="caption frontpage" rel="popover" data-content="<?php 
                echo ecs_short_excerpt(20) . '<br/>';
                ?>
<span class='label'><?php 
                the_time('j/m/Y');
                ?>
</span> 
											<span class='label'><?php 
                comments_number('Pas de commentaires', 'Un commentaire', '% commentaires');
                ?>
</span>" 
											data-original-title="<?php 
                the_title();
                ?>
">
											<h5><?php 
                the_title();
							</div>
						<?php 
            } else {
                ?>
							<div class="post">
								<a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a> | <?php 
                the_time('j/m/Y');
                ?>
 : <?php 
                echo ecs_short_excerpt(15);
                ?>
<br/>
								
							</div>
							<?php 
                if ($nbposts == $maxposts) {
                    break;
                }
                ?>
						<?php 
            }
            ?>
						<?php 
        }
        wp_reset_postdata();
Beispiel #3
0
function ecs_carousel($ecs_query = '', $cols = 8)
{
    $my_query = new WP_Query($ecs_query);
    $colimg = 4;
    $coltxt = $cols - 4;
    ?>
<div id="top_carousel" class="carousel slide"> 

  <!-- Carousel items -->
  <div class="carousel-inner">
  	<?php 
    $first = true;
    while ($my_query->have_posts()) {
        $my_query->the_post();
        $cat = get_single_top_category(get_the_ID());
        ?>
	    <div class="item <?php 
        if ($first) {
            echo 'active';
            $first = false;
        }
        ?>
">
	    	<div class="row">
	    		<a href="<?php 
        the_permalink();
        ?>
" rel="bookmark" title="Lien permanent vers <?php 
        the_title();
        ?>
">
	    	<div class="span<?php 
        echo $colimg;
        ?>
">
          	<img src="<?php 
        echo bloginfo('template_url');
        ?>
/scripts/timthumb.php?src=<?php 
        echo get_custom_thumbnail($post);
        ?>
&w=370&h=240&zc=1&q=100">
         </div>
	    	<div class="span<?php 
        echo $coltxt;
        ?>
">
	    		<h2><?php 
        the_title();
        ?>
</h2>
	    		<p><?php 
        echo ecs_short_excerpt(50);
        ?>
</p>
	    	</div>
	    	</a>
	    </div>
	  </div>
    <?php 
    }
    ?>
  </div>
	  <!-- Carousel nav -->
	  <?php 
    if ($my_query->post_count > 1) {
        ?>
		  <a class="carousel-control left" href="#top_carousel" data-slide="prev">&lsaquo;</a>
		  <a class="carousel-control right" href="#top_carousel" data-slide="next">&rsaquo;</a>
		<?php 
    }
    ?>

	</div>
<?php 
    wp_reset_postdata();
}
        echo $parent->description;
        ?>
"><i class="icon-chevron-right icon-white"></i></span><?php 
        echo $cat->name;
        ?>
</span><br/>
			<a href="<?php 
        the_permalink();
        ?>
" rel="bookmark"><?php 
        the_title();
        ?>
</a>
			<p>
			<?php 
        echo ecs_short_excerpt(20);
        ?>
		</p>
		</li>
		<?php 
    }
    ?>
	</ul>
<?php 
} else {
    ?>
	<ul><li>
		<p>Pas d'articles similaires.</p>
	</li></ul>
<?php 
}
											<a href="<?php 
    the_permalink();
    ?>
">

												<img src="<?php 
    bloginfo('template_directory');
    ?>
/scripts/timthumb.php?src=<?php 
    echo get_custom_thumbnail($post);
    ?>
&w=370&h=268&zc=1&q=100">
														
											</a>
											<div class="caption frontpage" rel="popover" data-content="<?php 
    echo ecs_short_excerpt(50);
    ?>
<br/><span class='label'><?php 
    the_time('j/m/Y');
    ?>
</span> 
													<span class='label'><?php 
    comments_number('Pas de commentaires', 'Un commentaire', '% commentaires');
    ?>
</span>" 
													data-original-title="<?php 
    the_title();
    ?>
">
													<h4><?php 
    the_title();
Beispiel #6
0
function ecs_widget_post_display($excerpt_length = 20, $cat = '', $has_comments = false, $has_date = false)
{
    // $excerpt_length = empty($instance['excerpt_length']) ? $excerpt_length : $instance['excerpt_length'];
    if (empty($cat) && $excerpt_length == 0) {
        echo '<li class="sidebar-link">';
    } else {
        echo '<li>';
    }
    ?>
		<?php 
    if (!empty($cat)) {
        if ($cat->parent == 0) {
            $parent = $cat;
        } else {
            $parent = get_category($cat->parent);
        }
        ?>

		<span style="color:<?php 
        echo $parent->description;
        ?>
"><span style="background-color:<?php 
        echo $parent->description;
        ?>
"><i class="icon-chevron-right icon-white"></i></span><?php 
        echo $cat->name;
        ?>
</span><br/>
		<?php 
    }
    ?>
		<a href="<?php 
    the_permalink();
    ?>
" rel="bookmark"><?php 
    the_title();
    ?>
</a>
		<?php 
    $comments_number = get_comments_number();
    if ($has_comments && $comments_number > 0) {
        ?>
		&nbsp;<span class="badge" title="Nb de commentaires"><?php 
        echo get_comments_number();
        ?>
</span>
		<?php 
    }
    ?>
		<p>
			<?php 
    if ($excerpt_length > 0) {
        echo ecs_short_excerpt($excerpt_length);
    }
    ?>
			<?php 
    if ($has_date) {
        ?>
			<br/>
			<span class="post-info">Publié le <?php 
        the_time('j/m/Y');
        ?>
</span>
			<?php 
    }
    ?>
		</p>
	</li>
<?php 
}