简体   繁体   English

Wordpress用home_url替换bloginfo?

[英]Wordpress replacing bloginfo with home_url?

In my header file, I'm using Wordpress function bloginfo following three times: 在我的头文件中,我使用了以下3次Wordpress函数bloginfo

<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />

But the theme check plugin gives me following warning: 但是主题检查插件给我以下警告:

bloginfo(url) was found in the file header.php. Use echo home_url() instead.

Can someone tell me how can I replace the that? 有人可以告诉我如何更换那个吗? I couldn't find any information in the function references on Wordpress website. 我在Wordpress网站上的功能参考中找不到任何信息。

It may be not in your header.php . 它可能不在您的header.php

find on all your active theme files any reference to: 所有活动主题文件上找到对以下内容的任何引用:

bloginfo('url');

and replace it with: 并替换为:

echo home_url();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM