the_post_thumbnail as https
-
Hi guys,
As always thanks for helping in advance. This one has left me scratching my head.
Currently I’m grabbing the post thumbnail and wrapping it in a href which links to the post. It works absolutely fine as expected.
However I’ve recently installed an SSL license on the site and fixed all calls to images etc to https rather than http. The final piece is to force my code to change the call on the thumbnails to https also.
Currently my code looks like:
<?php if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) : /* if the post has a WP 2.9+ Thumbnail */?> <a title="<?php echo ''.get_the_title(); ?>" href="<?php echo get_permalink($post->ID); ?>"> <?php the_post_thumbnail('blog', array('class' => 'scale-with-grid')); /* post thumbnail settings configured in functions.php */ ?> </a> <?php endif; ?>
My question is how to I get the php to search the string returned (which is an url to the image) to https rather than http. Using a plugin to force this across the site isn’t an option unfortunately.
Many thanks,
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘the_post_thumbnail as https’ is closed to new replies.