WordPress:增强文本小工具真的很强大

效果见此网站首页或者“http://yanyubao.tseo.cn”。

 

外观>>Qiye211主题选项>>定制风格

 

增加以下代码:

 

/* 定义功能模块列表的CSS Begin */
.col-1 {background-color: #fff;}
#section .row .col .section-box .g4 .box-4{border: 0;}
#section .row .col .section-box .g4 .box-4 .section-thumbnail img{max-width: 100%;
border-radius: 5%;
margin: 0 auto;}
#section .row .col .section-box .g4 .box-4 h3{font-size: 20px; font-weight: 200;}

.row .widget_media_image{text-align:center;}

.widget-title{text-align:center;}

/* 定义功能模块列表的CSS End */

 

外观>>小工具>>主题 增强文本

连续设置6个增强文本,代码如下:

<style type="text/css">
.g4_new{
width:25%;
}
.box-4-new{
border-radius: 10px;
}
.g4_new img{
width:114px;
}
</style>
<?php
echo '';

$url = 'http://yanyubao.tseo.cn/index.php/Supplier/Login/show_yanyubao_module_list_for_tseo_cn';

$json = wp_cache_get('yanyubao_module_list_json');
if(!$json){
$request = new WP_Http;
$result = $request->request( $url );
$json = $result['body'];
//print_r($result);

wp_cache_set('yanyubao_module_list_json', $json, '', 3600);
}

$module_list001 = json_decode($json, true);
if($module_list001['code'] == 1){

echo '<div class="section-box pany-hide pany-show">';

$module_list = $module_list001['data'];

$iii = 0;
foreach($module_list as $module_group){

$iii ++;

if($iii != 1){
continue;
}

 

foreach($module_group['subs'] as $item){
//echo $item['name'];
echo '
<div class="g4 g4_new">
<div class="box-4 box-4-new">

<a href="'.$item['link'].'">
<figure class="section-thumbnail">
<img src="'.$item['icon'].'" alt="'.$item['name'].'" style="width: 114px;padding: 10px;background-color:'.$item['background-color'].';"> </figure>
<h3 class="g4-title" style="font-size:15px; margin:0;">'.$item['name'].'</h3>
</a> </div>
</div>
';
}
}
echo '</div>';

}
?>

每个增强文本的对应的  if($iii != 2)  判断不同,为了的是将不同的分类分别显示出来,以达到分多次分别动态显示出来的效果。

admin