duanhuan1147 2015-02-16 17:44
浏览 11

Wordpress图像组合

i am new to wordress i want to make image gallery from basic bootstrap template

i have this template for example:

<div class="row portfolio-images">
  <div class="col-md-3">
    <img src="">
     <a class="title" >title</a> 
  </div>
  <div class="col-md-3">
    <img src="" alt="">
    <a class="title" >title</a> 
  </div>
  <div class="col-md-3">
    <img src="" alt="">
    <a class="title" >title</a> 
  </div>
  <div class="col-md-3">
    <img src="" alt="">
    <a class="title" >title</a> 
  </div>
</div>

i want to know how to create image database or gallery in wordpress in the panel and get the images url in an array and do something like this:

   <div class="row portfolio-images">
  <?php 
  for(the array){ ?>

      <div class="col-md-3">
        <img src="<?php echo image url ?> ">
         <a class="title" ><?php echo image title ?></a> 
      </div>
      <?php }?>

    </div>

because im lost right now and i need some guidence

  • 写回答

1条回答 默认 最新

  • douping4436 2015-02-16 17:53
    关注

    There are various plugins that you can use to generate the gallery. If you need to generate one without plugin then you can define a custom post type and then add images post on the relevant post type, which then can be listed on the required page.

    Usually I use ACF plugin to generate custom field and then list it on the page. You can check it more here: http://www.advancedcustomfields.com/resources/gallery/

    评论

报告相同问题?

悬赏问题

  • ¥15 WPF 大屏看板表格背景图片设置
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示