doubi3929 2014-05-12 11:04
浏览 143

如何在bootstrap轮播中显示相同大小的图像

I have been using the following code to display the images in Bootstrap carousel:

<a href="<?php echo get_page_link( $page->ID ); ?>"> 
    <?php $image = wp_get_attachment_image( get_post_thumbnail_id($page->ID), 'child-page','', array('class' => "img-responsive img-shadow", 'alt' => get_the_title()))  ?>
    <?php echo $image; ?> 
</a> 

I have added add_image_size( 'child-page', 400, 200, true ); in functions.php but it is displaying the images of variable height.

How do I control size without having to optimize the images?

  • 写回答

3条回答 默认 最新

  • dru5089 2014-05-12 11:08
    关注

    Why not put in your style.css

    .carousel-inner img{
      width: 400px;
      height: 200px;
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥15 opencv 无法读取视频
  • ¥15 用matlab 实现通信仿真
  • ¥15 按键修改电子时钟,C51单片机
  • ¥60 Java中实现如何实现张量类,并用于图像处理(不运用其他科学计算库和图像处理库))
  • ¥20 5037端口被adb自己占了
  • ¥15 python:excel数据写入多个对应word文档
  • ¥60 全一数分解素因子和素数循环节位数
  • ¥15 ffmpeg如何安装到虚拟环境
  • ¥188 寻找能做王者评分提取的
  • ¥15 matlab用simulink求解一个二阶微分方程,要求截图