wordpress snippets last updated   : August 18, 2014
we now have 638 snippets

Force specific pages to be secure, ssl, https

wordpress snippet

You can easily force specific pages to be secure in wordpress using the following simple little snippet. Just add the following snippet to the functions.php of your wordpress theme and specify the post / page ID desired.

snippet :  PHPcopy
function wps_force_ssl( $force_ssl, $post_id = 0, $url = '' ) {
    if ( $post_id == 25 ) {
        return true
    }
    return $force_ssl;
}
add_filter('force_ssl' , 'wps_force_ssl', 10, 3);

Did you like this post? If so please share it with your friends. Thanks!

jqsnipp.com | we just launched jquery snippets website