dongyonglie5132 2015-11-16 10:47
浏览 6

Wordpress中的类别列表

I am trying to list categories according to attached image, but didn't get any success, please help me if anyone has any idea. South, East and North will be in loop, so i can add any other at anytime, I am new in php or Wordpress so need your help enter image description here

 <?php $args = array('orderby' => 'id', 'hide_empty'=> 0, 'child_of' => 1); $categories = get_categories($args); foreach ($categories as $cat) { $background_color = get_option('cat_background_color'.$cat->term_id); ?>
    <div class="col-lg-5 col-md-5 col-sm-5 col-xs-12 boxshadow categorylisting padd0 Box1">
  <div class="Catheading cat1" style="background-color: #<?php echo  $background_color; ?>;"> <span class="config"><img src="<?php echo z_taxonomy_image_url($cat->term_id); ?>" alt="" /></span>
    <h3><?php echo $cat->name ?></h3>
  </div>
    <div class="catlist">
    <ul>
      <?php   $args2= array("orderby"=>'id', "category" => $cat->cat_ID); // Get Post from each Sub-Category
    $posts_in_category = get_posts($args2);
    foreach($posts_in_category as $current_post) {

        ?>
      <li type='none' ><a href="<?=$current_post->guid;?>">
        <?=''.$current_post->post_title;?>
        </a></li>
      <?php
    } ?>
    </ul>
  </div>
</div>
<?php   } ?>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
    • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
    • ¥16 mybatis的代理对象无法通过@Autowired装填
    • ¥15 可见光定位matlab仿真
    • ¥15 arduino 四自由度机械臂
    • ¥15 wordpress 产品图片 GIF 没法显示
    • ¥15 求三国群英传pl国战时间的修改方法
    • ¥15 matlab代码代写,需写出详细代码,代价私
    • ¥15 ROS系统搭建请教(跨境电商用途)
    • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。