[英]How to edit get_bloginfo('template_directory') to localhost instead of real domain?
[英]Wordpress get_bloginfo('template_directory') returns hostname instead of website url
我安裝的Wordpress主題無法顯示某些圖像,因為它們無法解析。 相對鏈接有效,但是當使用上述phpcode時,它使用我的內部主機名(不是fqdn)我收到的錯誤是:
無法加載資源:找不到具有指定主機名的服務器:
"http://dove/wordpress/wp-content/themes/Avada/images/logo.png"
我試圖了解為什么它不僅僅使用我配置的網站url,因此查找模板目錄和所需的任何資源。 我該如何解決? dove是我的主機名,而不是我從中訪問Wordpress的外部網站URL。 任何信息表示贊賞。
沒錯,應該這樣做。 我認為您不需要使用get_bloginfo();
但是,除非您打算對其內容進行處理。
使用<?php bloginfo('url'); ?>
<?php bloginfo('url'); ?>
返回您的網站網址。
或者只是使用<?php bloginfo('template_url'); ?>
<?php bloginfo('template_url'); ?>
返回您的模板位置。
有關可用於bloginfo
的完整列表,請查看Codex。 http://codex.wordpress.org/Function_Reference/bloginfo
小修正...需要添加回聲。
<?php echo get_bloginfo('template_url') ?>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.