【问题标题】:print_thumbnail is Not behaving well in wordpressprint_thumbnail 在 wordpress 中表现不佳
【发布时间】:2012-11-01 06:03:57
【问题描述】:
print_thumbnail(
 $arr[$i]["thumb_small"], $arr[$i]["use_timthumb"], 
 $arr[$i]["fulltitle"] ,$width_small,$height_small
);

在图片标签中返回

src="/domains/web2760/web//wp-content/uploads/2012/01/Gates-124086_132x58.jpg" 

而不是

src="/wp-content/uploads/2012/01/Gates-124086_132x58.jpg"

请帮帮我

【问题讨论】:

标签: php html css wordpress


【解决方案1】:

不要使用print_thumbnail,这是WP内部功能,必须使用get_the_post_thumbnail:

http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail

或者如果你在循环中,你可以使用 the_post_thumbnail:

http://codex.wordpress.org/Function_Reference/the_post_thumbnail

【讨论】:

  • 感谢分享,因为有些插件仍然引用后者,而我们应该使用前者。我进去并进行了修改,现在正在帮助我的 wordpress 项目完成。
猜你喜欢
  • 1970-01-01
  • 2012-03-13
  • 1970-01-01
  • 2018-03-30
  • 1970-01-01
  • 2017-07-26
  • 1970-01-01
  • 2012-02-05
  • 2011-06-01
相关资源
最近更新 更多