2014-09-04 55 views
0

我已經更新我的WordPress的地址(網址)和網站地址(URL)爲https://在WordPress的一般設置,因爲我已經添加了一個安全證書的託管。WordPress的地址URL和博客信息

應的CSS URL自動更新以反映新的地址,如果我在頭部代碼使用

 <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" /> 

的URL是現在https://開頭,但CSS網址仍然pointint到http://

回答

2

您將需要使用site_url($path_to_style_sheet, 'https')而不是bloginfo()

home_url()方法也支持https。

0

您應該使用:

<?php get_stylesheet_uri(); ?> 

換句話說:

<link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_uri(); ?>" />