function the_category_thumbnail($category_id = null, $sizes = array())
{
    print get_the_category_thumbnail($category_id, $sizes);
}
Example #2
0
defined('ABSPATH') or die;
$sidebar = get_query_var('sidebar');
dynamic_sidebar($sidebar);
?>

<?php 
//for each category, show all posts
echo '<div id="acordeon" class="widget"><h3 class="widget_title">Categorías</h3>';
$cat_args = array('orderby' => 'name', 'order' => 'ASC');
$categories = get_categories($cat_args);
foreach ($categories as $category) {
    $args = array('showposts' => 3, 'category__in' => array($category->term_id), 'caller_get_posts' => 1);
    $posts = get_posts($args);
    if ($posts) {
        echo '<div class="cont-categories ' . $category->name . '">' . get_the_category_thumbnail($category->term_id) . '<h4 title="' . sprintf(__("View all posts in %s"), $category->name) . '" ' . '>' . $category->name . '</h4>';
        echo '<ul class="post-category" style="display:none;">';
        foreach ($posts as $post) {
            setup_postdata($post);
            ?>
          
          	<li><a href="<?php 
            the_permalink();
            ?>
" rel="bookmark" title="Permanent Link to <?php 
            the_title_attribute();
            ?>
"><?php 
            the_title();
            ?>
</a></li>