I have updated my Wordpress Address (URL) and Site Address (URL) to be https:// in the General Settings of Wordpress as I have added a secruity certificate to the hosting.
Should the css url automatically update to reflect the new address if I'm using
<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" />
in the header code.
The url is now https:// but the css url is still pointint to http://
You will need to use site_url($path_to_style_sheet, 'https')
instead of bloginfo()
.
The home_url()
method also supports https.
You should be using:
<?php get_stylesheet_uri(); ?>
In other words:
<link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_uri(); ?>" />
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.