<?php
$switcher = _ceo('title_only');
if($switcher){
?>
<div class="ceo-phbf ceo-container ceo-margin-medium-top ceo-margin-bottom-40">
    <div class="ceo-title-row">
        <?php
        if ($switcher) {
        foreach ( $switcher as $key => $value) {
            if(!$value['id']){
                continue;
            }
        ?>
    <div class="m-home-ranking__content__item">
        <div class="ceo_title_only">
            <div class="item_title ceo-flex" style="background-image: url(<?php echo esc_url( $value['img'] ); ?>)">
                <a href="<?php echo get_category_link( $value['id'] ); ?>" target="_blank" class="ceo-flex-1">
                <?php echo get_cat_name($value['id']) ?></a>
                <a href="<?php echo get_category_link( $value['id'] ); ?>" target="_blank" class=""><i class="iconfont icon-Rightbutton"></i></a>
            </div>
            <div class="tab-content" style="">
                <div class="tab-pane  fade in active" id="tolist1" style="overflow: hidden;">
                    <?php query_posts('cat='.$value['id'] .'&showposts='.$value['num'] ); ?>
                    <?php
                    $i=0;
                    while (have_posts()) : the_post();
                        $i++;
                    ?>
                    <div class="g_text">
                        <a target="_blank" href="<?php echo get_permalink();?>" title="<?php echo get_the_title();?>" alt="<?php echo get_the_title();?>"><span class="num num<?php echo $i;?>"><?php echo $i;?></span><?php echo get_the_title();?></a>
                    </div>
                    <?php endwhile; wp_reset_query(); ?>
                </div>
            </div>
        </div>
    </div>
    <?php } } ?>
</div>
</div>
<?php }?>
