字preSS print_thumbnail没有给予正确的URL [英] Wordpress print_thumbnail not giving correct url

查看:170
本文介绍了字preSS print_thumbnail没有给予正确的URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直有一个困难时期这个问题。
我在Ubuntu服务器64位运行Word preSS 3.3.1

I've been having a hard time with this issue. I'm running Wordpress 3.3.1 on Ubuntu Server 64bit

所以,我能够上传图片并查看其使用所提供的网址。
然而,当我将它作为一个特征图像看来功能
print_thumbnail不给我正确的地址。
它添加在/ var / WWW /我/的wp-content /上传的/ etc ...之前
所以绝对路径名称将是正确的我的机器上用一些符号连接的帮助。

So I'm able to upload an image and view it using the url provided. However, when I set it as a feature image it appears that the function print_thumbnail is not giving me the correct address. It's adding in /var/www/ before my /wp-content/uploads/etc... So the absolute path name would be correct on my machine with the help of some symlinks.

我试图改变文件上的css来删除/ var /网络/和验证,这的确找到我的形象和工作。我已经看到了很多帖子说告诉我,改变CHMOD 777和背部755在的 WP print_thumbnail功能无法正常工作和<一个href=\"http://stackoverflow.com/questions/9003277/wp-print-thumbnail-function-not-working-correctly\">wp print_thumbnail功能不能正常工作我不知道这是怎么想解决这个问题,因为这似乎是一个路径问题。是否有某种重定向的基于权限?不管怎么说,它没有工作。

I tried changing the css on the file to remove the /var/www/ and verified that this did indeed find my image and worked. I've been seeing a lot of posts that tell me change chmod 777 and back to 755 as in wp print_thumbnail function is not working and wp print_thumbnail function not working correctly I don't know how this was suppose to fix the issue since this seems to be a pathing problem. Is there some sort of redirection based on permissions? Anyways, it didn't work.

有没有人有什么想法?

下面是一个例子职位
http://mobile.cs.fsu.edu/google-镀铬的应用上,Android的市场/

推荐答案

在我发现功能,它使用get_bloginfo功能打印出来的样式表目录

In the function I found out that it uses get_bloginfo function to print out stylesheet directory

$output = '<img src="'.get_bloginfo('stylesheet_directory').'/timthumb.php?src='.$thumbnail.'&amp;h='. $height .'&amp;w='. $width .'&amp;zc=1"';

字preSS $ C $的get_bloginfo ,它说:

stylesheet_directory' - 返回的样式表目录网址
  活动主题。 (在早期Word preSS版本的本地路径。)
  请考虑使用
get_stylesheet_directory_uri()代替

'stylesheet_directory' - Returns the stylesheet directory URL of the active theme. (Was a local path in earlier WordPress versions.) Consider using get_stylesheet_directory_uri() instead.

更改get_bloginfo('stylesheet_directory')来get_stylesheet_directory_uri()


我没有尝试它自己,希望它帮助。

Change the get_bloginfo('stylesheet_directory') to get_stylesheet_directory_uri()
I did not try it myself, hope it helps.

这篇关于字preSS print_thumbnail没有给予正确的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆