[英]Issue with bloginfo('stylesheet_url') in wordpress
[英]Wordpress address URL and bloginfo
我已在Wordpress的“常规设置”中将我的Wordpress地址(URL)和站点地址(URL)更新为https://,因为我已向主机添加了安全证书。
如果我正在使用,css url是否应自动更新以反映新地址
<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" />
在标题代码中。
网址现在为https://,但CSS网址仍指向http://
您将需要使用site_url($path_to_style_sheet, 'https')
而不是bloginfo()
。
home_url()
方法还支持https。
您应该使用:
<?php get_stylesheet_uri(); ?>
换一种说法:
<link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_uri(); ?>" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.