links - bloginfo(); outputs wrong urls without https on inner pages

admin2025-01-07  5

Template header has lines like this <link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/icons/favicon.ico">

The problem is that bloginfo('template_directory') and other functions that use site_url (get_template_uri etc.) output url with HTTP instead of HTTPS. It happens on every page excepting index page. On the main page urls are correct, with https.

So inner pages are broken because of mixed content.

Site home and wp home in settings are set to . All http links in database are replaced with https links. Nothing hepled.

What else should I check?

Template header has lines like this <link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/icons/favicon.ico">

The problem is that bloginfo('template_directory') and other functions that use site_url (get_template_uri etc.) output url with HTTP instead of HTTPS. It happens on every page excepting index page. On the main page urls are correct, with https.

So inner pages are broken because of mixed content.

Site home and wp home in settings are set to https://example.net. All http links in database are replaced with https links. Nothing hepled.

What else should I check?

Share Improve this question asked Jun 28, 2018 at 11:50 Maria PiaredryjMaria Piaredryj 1011 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

According to documentation, get_stylesheet_directory_uri() should check for SSL while retrieving the theme directory url.

Try exchanging <link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/icons/favicon.ico"> to <link rel="shortcut icon" href="<?php echo get_stylesheet_directory_uri(); ?>/icons/favicon.ico"> in your header.php file.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736253107a99.html

最新回复(0)