我目前正在尝试将 thimthumb 添加到我的 WordPress 模板中。
我的自定义帖子类型图像当前以以下方式显示:
<a class="image-link" href="<?php echo $url; ?>"><?php the_post_thumbnail('collection_cover', array('class' => 'cover')); ?></a>
这个原始方法工作正常,输出为:
<a class="image-link" href="http://myURL.com"><img width="202" height="408" src="http://myURL.com/wp-content/uploads/2012/10/Untitled-12.jpg" class="cover wp-post-image" alt="Untitled-1" title="Untitled-1"></a>
我试图用以下内容替换上述内容:
<a class="image-link" href="<?php echo $url; ?>"><img src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php the_post_thumbnail('collection_cover', array('class' => 'cover')); ?>&h=150&w=150&zc=1" alt="<?php the_title(); ?>" width="100" height="57" /></a>
输出为:
<a class="image-link" href="http://myURL.com"><img src="http://myURL.com/scripts/timthumb.php?src=<img width=" 202"="" height="408" class="cover wp-post-image" alt="Untitled-1" title="Untitled-1">&h=150&w=150&zc=1" alt="Test" width="100" height="57" /></a>
但是它似乎无法正常工作 - 任何人都知道我怎样才能让它工作?一些专家的建议将不胜感激。