Esempio n. 1
0
<?php

$cat = get_post_child_category($post->ID);
if ($cat->parent == 0) {
    $parent = $cat;
} else {
    $parent = get_category($cat->parent);
}
?>
<div class="row">
	<div class="span2">
		<ul class="thumbnails">
			<li class="span2">
				<a href="<?php 
the_permalink();
?>
" class="thumbnail">
					<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>
			</li>
		</ul>
	</div>
	<div class="span6">
		<span style="color:<?php 
echo $parent->description;
Esempio n. 2
0
<?php

/*
EcoRes YARPP Template
Author: enetter (Emmanuel Netter)
*/
if (have_posts()) {
    ?>
	<ul>
		<?php 
    while (have_posts()) {
        the_post();
        $cat = get_post_child_category(get_the_ID());
        $parent = get_category($cat->parent);
        ?>
		<li>
			<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/>
			<a href="<?php 
        the_permalink();
        ?>
" rel="bookmark"><?php 
        the_title();
Esempio n. 3
0
    function widget($args, $instance)
    {
        extract($args, EXTR_SKIP);
        echo $before_widget;
        $title = empty($instance['title']) ? '&nbsp;' : apply_filters('widget_title', $instance['title']);
        $nbposts = empty($instance['nbposts']) ? -1 : $instance['nbposts'];
        if (!empty($title)) {
            echo $before_title . $title . $after_title;
        }
        $recent_posts = new WP_Query(array('post_type' => 'post', 'posts_per_page' => $nbposts, 'orderby' => 'comment_count'));
        ?>
		<?php 
        if ($recent_posts->have_posts()) {
            ?>
			<ul>
				<?php 
            while ($recent_posts->have_posts()) {
                $recent_posts->the_post();
                if ($instance['show_category']) {
                    $cat = get_post_child_category(get_the_ID());
                }
                ?>
					<?php 
                echo ecs_widget_post_display($instance['excerpt_length'], $cat, $instance['show_comments'], $instance['show_date']);
                ?>
				<?php 
            }
            ?>
			</ul>
		<?php 
        } else {
            ?>
			<ul><li>
				<p>Pas d'articles récents.</p>
			</li></ul>
		<?php 
        }
        ?>
  <?php 
        echo $after_widget;
        wp_reset_query();
    }