arashster
Forum Replies Created
-
Forum: Plugins
In reply to: [Multiple Themes] Not working for WordPress Version 6.4.1I had the same issue with 6.4.1, but the update to 6.4.2 seems to have fixed it.
Can anyone else confirm?
Forum: Plugins
In reply to: [Multiple Themes] Multiple Themes not working with WP 6.4.1I had the same issue with 6.4.1, but the update to 6.4.2 seems to have fixed it.
Can anyone else confirm?
Forum: Plugins
In reply to: [Multiple Themes] Multiple Themes not working with WP 6.4.1I had the same issue with 6.4.1, but the update to 6.4.2 seems to have fixed it.
Can anyone else confirm?
function checkSsl() { if (g('ssl') != '' && g('ssl') != 'off' && g('ssl') != '0' && $_SERVER['HTTPS'] != 'on') { $vurl = "https://". $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; header("Location: " . $vurl); die(); } } function g($attribute, $random=false, $page='') { global $post; global $post_attributes; $return = ''; if ($page == '') { $page = $post->ID; } if($post_attributes == '') { $post_attributes = array(); } if($post_attributes[$page] == '') { $post_attributes[$page] = get_post_custom($page); } if (!$random) { $return = $post_attributes[$page][$attribute][0]; } else { $r = $post_attributes[$page][$attribute]; if (is_array($r)){ $x = array_rand($r); $return = $post_attributes[$page][$attribute][$x]; } } return $return; }
put the two functions in functions.php
g() is a shorthand function I use to get the custom attribute for the current page or any other page.
just put checkSsl() at the top of page.php or any other page template and it should redirect. Quick and dirty, I know.[Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code may now have been permanently damaged/corrupted by the forum’s parser.]
I too am on media template.
For the meantime, I implemented my own setting in functions.php
Basically, I check for a custom attribute called ‘ssl’ on my page, and if it exists, it redirects to the SSL page.