/* Header for posts*/
-function glm_get_background() {
+function glm_get_background() {
if (has_post_thumbnail() && !is_woocommerce() && !is_shop() && !is_category() && !is_cart() && !is_checkout() && !is_account_page() && !is_home() && !is_archive() && !is_single() &&
!is_page( array('product-category','cart','checkout','my-account'))
) {
} else {
$imageUrl = '<div class="featured-image" style="background: url(\''.get_template_directory_uri().'/assets/shipwreck-museum.jpg\') no-repeat scroll 0px 0px / cover;;"></div>';
}
- return $imageUrl;
+ return $imageUrl;
}
-function get_product_category_by_id($cat_id)
+function get_product_category_by_id($cat_id)
{
$category = get_term_by('id', $cat_id, 'product_cat', 'OBJECT');
- return $category;
+ return $category;
}
// // The code below is useful when you want the image to resize to
function disable_post_creation( $is_disabled, $form, $entry ) {
return true;
}
+add_action( 'wp', 'post_pw_sess_expire' );
+function post_pw_sess_expire() {
+ global $post;
+ if ( in_array( $post->ID, array( 4602, 4393 ) ) ) {
+ if ( isset( $_COOKIE['wp-postpass_' . COOKIEHASH] )) {
+ // Setting a time of 0 in setcookie() forces the cookie to expire with the session
+ setcookie('wp-postpass_' . COOKIEHASH, $_COOKIE['wp-postpass_' . COOKIEHASH], strtotime( '+20 minutes' ), COOKIEPATH);
+ }
+ }
+}
?>