File: /www/wwwroot/gxdaosen.net/wp-content/themes/simplepark/index/left_news.php
<?php $news1= get_option('mytheme_news1');
$news2= get_option('mytheme_news2');
$news3= get_option('mytheme_news3');
$news4= get_option('mytheme_news4');
$category1 = get_category($news1);
$category2 = get_category($news2);
$category3 = get_category($news3);
$category4 = get_category($news4);
?>
<div id="left_news">
<div class="left_news_hd">
<a id="cs1" class="inopen"><?php echo $category1->name; ?></a>
<?php if($news2 !==""){ ?> <a id="cs2"><?php echo $category2->name; ?></a><?php }; ?>
<?php if($news3 !==""){ ?> <a id="cs3"><?php echo $category3->name; ?></a><?php }; ?>
<?php if($news4 !==""){ ?> <a id="cs4"><?php echo $category4->name; ?></a><?php }; ?>
</div>
<ul class="news_loop_01 show" id="ss1">
<?php $posts = get_posts( "category=($news1)&numberposts=5" );
if( $posts ) :
$counter = 0;foreach( $posts as $post ) : setup_postdata( $post );$counter++; ?>
<?php if ($counter == 1 && get_query_var('paged') < 2):?>
<li id="photo">
<a href="<?php the_permalink() ?>" >
<?php $tit= get_the_title();if (has_post_thumbnail()) { the_post_thumbnail('news-sidbar-thumb' ,array('alt' =>$tit, 'title'=> $tit ));} ?>
</a>
<a class="titler" href="<?php the_permalink() ?>"> <?php echo mb_strimwidth(get_the_title(), 0, 25,"...","utf-8") ?></a>
</li>
<?php elseif ($counter == 2 && get_query_var('paged') < 3):?>
<li id="fistnopic">
<span>
<b><a href="<?php the_permalink() ?>"> <?php echo mb_strimwidth(get_the_title(), 0, 35,"...","utf-8") ?></a> <a class="time">TIME:<?php the_time('Y/m/d') ?></a></b>
<p> <?php echo mb_strimwidth(strip_tags(apply_filters('the_excerp',get_the_excerpt($id))),0,50,"...","utf-8"); ?></p>
</span>
</li>
<?php else : ?>
<li id="fistnopic">
<span>
<b><a href="<?php the_permalink() ?>"> <?php echo mb_strimwidth(get_the_title(), 0, 35,"...","utf-8") ?></a> <a class="time">TIME:<?php the_time('Y/m/d') ?></a></b>
</span>
</li>
<?php endif; ?>
<?php endforeach; ?>
<?php else : ?>
<?php endif; ?>
</ul>
<ul class="news_loop_01"id="ss2">
<?php $posts = get_posts( "category=($news2)&numberposts=5" );
if( $posts ) :
$counter = 0;foreach( $posts as $post ) : setup_postdata( $post );$counter++; ?>
<?php if ($counter == 1 && get_query_var('paged') < 2):?>
<li id="photo">
<a href="<?php the_permalink() ?>" >
<?php $tit= get_the_title();if (has_post_thumbnail()) { the_post_thumbnail('news-sidbar-thumb' ,array('alt' =>$tit, 'title'=> $tit ));} ?>
</a>
<a class="titler" href="<?php the_permalink() ?>"> <?php echo mb_strimwidth(get_the_title(), 0, 25,"...","utf-8") ?></a>
</li>
<?php elseif ($counter == 2 && get_query_var('paged') < 3):?>
<li id="fistnopic">
<span>
<b><a href="<?php the_permalink() ?>"> <?php echo mb_strimwidth(get_the_title(), 0, 35,"...","utf-8") ?></a> <a class="time">TIME:<?php the_time('Y/m/d') ?></a></b>
<p> <?php echo mb_strimwidth(strip_tags(apply_filters('the_excerp',get_the_excerpt($id))),0,100,"...","utf-8"); ?></p>
</span>
</li>
<?php else : ?>
<li id="fistnopic">
<span>
<b><a href="<?php the_permalink() ?>"> <?php echo mb_strimwidth(get_the_title(), 0, 35,"...","utf-8") ?></a> <a class="time">TIME:<?php the_time('Y/m/d') ?></a></b>
</span>
</li>
<?php endif; ?>
<?php endforeach; ?>
<?php else : ?>
<?php endif; ?>
</ul>
<ul class="news_loop_01"id="ss3">
<?php $posts = get_posts( "category=($news3)&numberposts=5" );
if( $posts ) :
$counter = 0;foreach( $posts as $post ) : setup_postdata( $post );$counter++; ?>
<?php if ($counter == 1 && get_query_var('paged') < 2):?>
<li id="photo">
<a href="<?php the_permalink() ?>" >
<?php $tit= get_the_title();if (has_post_thumbnail()) { the_post_thumbnail('news-sidbar-thumb' ,array('alt' =>$tit, 'title'=> $tit ));} ?>
</a>
<a class="titler" href="<?php the_permalink() ?>"> <?php echo mb_strimwidth(get_the_title(), 0, 25,"...","utf-8") ?></a>
</li>
<?php elseif ($counter == 2 && get_query_var('paged') < 3):?>
<li id="fistnopic">
<span>
<b><a href="<?php the_permalink() ?>"> <?php echo mb_strimwidth(get_the_title(), 0, 35,"...","utf-8") ?></a> <a class="time">TIME:<?php the_time('Y/m/d') ?></a></b>
<p> <?php echo mb_strimwidth(strip_tags(apply_filters('the_excerp',get_the_excerpt($id))),0,100,"...","utf-8"); ?></p>
</span>
</li>
<?php else : ?>
<li id="fistnopic">
<span>
<b><a href="<?php the_permalink() ?>"> <?php echo mb_strimwidth(get_the_title(), 0, 35,"...","utf-8") ?></a> <a class="time">TIME:<?php the_time('Y/m/d') ?></a></b>
</span>
</li>
<?php endif; ?>
<?php endforeach; ?>
<?php else : ?>
<?php endif; ?>
</ul>
<ul class="news_loop_01"id="ss4">
<?php $posts = get_posts( "category=($news4)&numberposts=5" );
if( $posts ) :
$counter = 0;foreach( $posts as $post ) : setup_postdata( $post );$counter++; ?>
<?php if ($counter == 1 && get_query_var('paged') < 2):?>
<li id="photo">
<a href="<?php the_permalink() ?>" >
<?php $tit= get_the_title();if (has_post_thumbnail()) { the_post_thumbnail('news-sidbar-thumb' ,array('alt' =>$tit, 'title'=> $tit ));} ?>
</a>
<a class="titler" href="<?php the_permalink() ?>"> <?php echo mb_strimwidth(get_the_title(), 0, 25,"...","utf-8") ?></a>
</li>
<?php elseif ($counter == 2 && get_query_var('paged') < 3):?>
<li id="fistnopic">
<span>
<b><a href="<?php the_permalink() ?>"> <?php echo mb_strimwidth(get_the_title(), 0, 35,"...","utf-8") ?></a> <a class="time">TIME:<?php the_time('Y/m/d') ?></a></b>
<p> <?php echo mb_strimwidth(strip_tags(apply_filters('the_excerp',get_the_excerpt($id))),0,100,"...","utf-8"); ?></p>
</span>
</li>
<?php else : ?>
<li id="fistnopic">
<span>
<b><a href="<?php the_permalink() ?>"> <?php echo mb_strimwidth(get_the_title(), 0, 35,"...","utf-8") ?></a> <a class="time">TIME:<?php the_time('Y/m/d') ?></a></b>
</span>
</li>
<?php endif; ?>
<?php endforeach; ?>
<?php else : ?>
<?php endif; ?>
</ul>
</div>