dongying9712 2010-07-20 15:29
浏览 120
已采纳

创建自定义函数以在WordPress中替换一个

I'm using WordPress 3.0 and the 'the_post_thumbnail' function to resize my images. The problem is that the function doesn't resize to exact dimensions when you don't specify a square image.

// Works fine
add_image_size('my-image-size',100, 100, true);

// Image is only resized to width or height, not both
add_image_size('my-image-size',265, 182, true);

I'm pretty sure this is a bug, as I feel the image should be cropped to both dimensions to make an exact size. I could just edit the 'image_resize_dimensions' function in media.php, but I'm wondering if there is a better way, some way to override that function with my own?

Thanks!

Darren.

  • 写回答

3条回答 默认 最新

  • duanci3845 2010-07-20 16:00
    关注

    In most of my theme development prior to 3.0 I used the timthumb plugin with much success. As i also found the built-in functions lacking. You can find the info here.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持