<?php get_header(); ?>
<div class="art-layout-wrapper">
<div class="art-content-layout">
<div class="art-content-layout-row">
<div class="art-layout-cell art-sidebar1">
<?php get_sidebar('default'); ?>
<div class="cleared"></div>
</div>
<div class="art-layout-cell art-content">
<?php get_sidebar('top'); ?>
<?php
if(have_posts()) {
/* Display navigation to next/previous pages when applicable */
if ( theme_get_option('theme_' . (theme_is_home() ? 'home_' : '') . 'top_posts_navigation' ) ) {
theme_page_navigation();
}
/* Start the Loop */
// while (have_posts()) {
// the_post();
// get_template_part('content', get_post_format());
// }
?>
<?php
$args = array(
'orderby' => 'name',
'order' => 'ASC',
'hierarchical' => false,
//'child_of' => 0,
'number' => '20'
);
$categories = get_categories($args);
foreach($categories as $category) {
if($category->parent < 1){
?>
<div class="art-box-body art-block-body bt-posts-list ">
<div class="art-bar art-blockheader">
<h3 class="t"><?php echo $category->name; ?></h3>
</div>
<div class="art-box art-blockcontent">
<div class="art-box-body art-blockcontent-body posts-list-height">
<?php
$args = array(
'numberposts' => 10,
'offset' => 0,
'category' => $category->cat_ID,
'orderby' => 'post_date',
'order' => 'DESC',
'include' => '',
'exclude' => '',
'meta_key' => '',
'meta_value' => '',
'post_type' => 'post',
'post_mime_type' => '',
'post_parent' => '',
'post_status' => 'publish',
'suppress_filters' => true
);
$posts_array = get_posts($args);
?>
<ul class="index-blocks-ul">
<?php
set_post_thumbnail_size( 227, 100, true );
$post_counter = 0;
foreach( $posts_array as $post ){
$post_counter++;
setup_postdata($post);
?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php
if ( $post_counter == 1 && has_post_thumbnail($post->ID) ) {
echo '<div style="margin-top: 5px;">
<a href="'.get_permalink($post->ID).'">'.get_the_post_thumbnail($post->ID).'</a>
</div>';
}
}?>
</ul>
</div>
</div>
</div>
<?php
}
}
/* Display navigation to next/previous pages when applicable */
if (theme_get_option('theme_bottom_posts_navigation')) {
// theme_page_navigation();
}
} else {
theme_404_content();
}
?>
<?php get_sidebar('bottom'); ?>
<div class="cleared"></div>
</div>
<div class="art-layout-cell art-sidebar2">
<?php get_sidebar('secondary'); ?>
<div class="cleared"></div>
</div>
</div>
</div>
</div>
<div class="cleared"></div>
<?php get_footer(); ?>