donglue8180 2015-11-14 10:49
浏览 104

由于主题,Wordpress图片尺寸太小

My theme generate my img portfolio with this code :

<img width="222" height="440" src="#" class="attachment-portfolio" alt="#">

I found this code :

<div class="carousel-inner">
    <?php foreach($attachments as $attachment) {
        $alt = get_post_meta($attachment->ID, '_wp_attachment_image_alt', true);                    
        $image_big =  wp_get_attachment_image( $attachment->ID, 'portfolio' ); ?>
        <div class="item">
            <?php echo $image_big ?>
        </div>
<?php } ?>

I'm not good in PHP but i understand that the image size is generate from "$image_big" ?

I found also this in my function.php

add_image_size('big',9999,400);

I try to change the width and height in the add_image_size but nothing happend on the website ! It's still width="222" height="440" I would like the image to be 100% or around 800px width (if it's impossible to get % unit). What to do ?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥60 求一个简单的网页(标签-安全|关键词-上传)
    • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
    • ¥15 基于卷积神经网络的声纹识别
    • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
    • ¥100 为什么这个恒流源电路不能恒流?
    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 CSAPPattacklab
    • ¥15 一直显示正在等待HID—ISP