WordPress的通用模板中Bloginfo的值能不能改? [英] Can you change the value of the Bloginfo in the general-template of WordPress?

查看:54
本文介绍了WordPress的通用模板中Bloginfo的值能不能改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我面临着巨大的挑战,我正在处理一个已从 HTML 转换为 WordPress 的网站,我的首页显示所有内容正确,但其他页面显示不正确,因为 url 指向不正确.我想知道是否有一种方法可以更改 wp-includes/general-template.php 中的主 url 路径值,而不是手动更改 150 个页面中的所有 URL:

I am facing a great challenge, I am working on a site that has been converted from HTML into WordPress and I have the front-page displaying all the content right but not the other pages as the urls are not pointing correctly. I wonder if instead of changing manually all the URL from 150 pages there is a way that I change the main url path values in wp-includes/general-template.php from this:

    <?php  bloginfo('template_url');  ?>

进入类似于真实 URL 的内容:http://example.com/

into something like the real URL: http://example.com/

换句话说,如果成功,我将只对 wp-includes/general-template.php 做一个更改,并修复所有损坏的链接......?

In other word by doing so, if successful, I will make only one change on the wp-includes/general-template.php and have all the broken links fixed...?

有人知道吗?

非常感谢......(我的时间和选项都用完了......非常感谢帮助......:)

Many thanks all....(I am running out of time and options....help is greatly appreciated..:)

丹尼尔

推荐答案

通过将第 693 行的 wp-includes/general-template.php 更改为以下内容,找到了解决方法:

Found a way around by changing the wp-includes/general-template.php on line 693 from the following:

    case 'template_directory':
    case 'template_url':
        $output = get_template_directory_uri();

以下内容:

    case 'template_directory':
    case 'template_url':
        $output = site_url( 'mising_url_path_here' );

现在我已经修复了 js/images/other 文件的所有损坏链接,可以查看了.

now I have fixed all the broken link for js/images/other files and can be viewed.

这篇关于WordPress的通用模板中Bloginfo的值能不能改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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