Skip to main content
replaced http://wordpress.stackexchange.com/ with https://wordpress.stackexchange.com/
Source Link

Based on answers like this oneanswers like this one, I made a small plugin to display a theme displaying a "Coming soon" theme, whilst our team of editors can fill in the final theme.

It worked yesterday, but today, even though I'm logged in, I only see the "waiting" theme. I logged out and logged back in, but still, I'm seeing the "waiting" theme, as if the is_user_logged_in() function returned false. Are these hooks too early to check for user authentification?

<?php

add_filter('template', 'pxln_change_theme');
add_filter('stylesheet', 'pxln_change_theme');

function pxln_change_theme($theme) {    
    if ( ! is_user_logged_in() ) {
        $theme = 'waiting';
    }
    return $theme;
}

Based on answers like this one, I made a small plugin to display a theme displaying a "Coming soon" theme, whilst our team of editors can fill in the final theme.

It worked yesterday, but today, even though I'm logged in, I only see the "waiting" theme. I logged out and logged back in, but still, I'm seeing the "waiting" theme, as if the is_user_logged_in() function returned false. Are these hooks too early to check for user authentification?

<?php

add_filter('template', 'pxln_change_theme');
add_filter('stylesheet', 'pxln_change_theme');

function pxln_change_theme($theme) {    
    if ( ! is_user_logged_in() ) {
        $theme = 'waiting';
    }
    return $theme;
}

Based on answers like this one, I made a small plugin to display a theme displaying a "Coming soon" theme, whilst our team of editors can fill in the final theme.

It worked yesterday, but today, even though I'm logged in, I only see the "waiting" theme. I logged out and logged back in, but still, I'm seeing the "waiting" theme, as if the is_user_logged_in() function returned false. Are these hooks too early to check for user authentification?

<?php

add_filter('template', 'pxln_change_theme');
add_filter('stylesheet', 'pxln_change_theme');

function pxln_change_theme($theme) {    
    if ( ! is_user_logged_in() ) {
        $theme = 'waiting';
    }
    return $theme;
}
edited tags
Link
cjbj
  • 15k
  • 16
  • 42
  • 89
Tweeted twitter.com/StackWordPress/status/814133747884949504
added 2 characters in body
Source Link
cjbj
  • 15k
  • 16
  • 42
  • 89

Based on answers like this one, I made a small plugin to display a theme displaying a "Coming soon" theme, whilst our team of editors can fill in the final theme.

It worked yesterday, but today, even though I'm logged in, I only see the "waiting" theme. I logged out and logged back in, but still, I'm seeing the "waiting" theme, as if the is_user_logged_in()is_user_logged_in() function returned false. Are these hooks too early to check for user authentification?

<?php

add_filter('template', 'pxln_change_theme');
add_filter('stylesheet', 'pxln_change_theme');

function pxln_change_theme($theme) {    
    if ( ! is_user_logged_in() ) {
        $theme = 'waiting';
    }
    return $theme;
}

Based on answers like this one, I made a small plugin to display a theme displaying a "Coming soon" theme, whilst our team of editors can fill in the final theme.

It worked yesterday, but today, even though I'm logged in, I only see the "waiting" theme. I logged out and logged back in, but still, I'm seeing the "waiting" theme, as if the is_user_logged_in() function returned false. Are these hooks too early to check for user authentification?

<?php

add_filter('template', 'pxln_change_theme');
add_filter('stylesheet', 'pxln_change_theme');

function pxln_change_theme($theme) {    
    if ( ! is_user_logged_in() ) {
        $theme = 'waiting';
    }
    return $theme;
}

Based on answers like this one, I made a small plugin to display a theme displaying a "Coming soon" theme, whilst our team of editors can fill in the final theme.

It worked yesterday, but today, even though I'm logged in, I only see the "waiting" theme. I logged out and logged back in, but still, I'm seeing the "waiting" theme, as if the is_user_logged_in() function returned false. Are these hooks too early to check for user authentification?

<?php

add_filter('template', 'pxln_change_theme');
add_filter('stylesheet', 'pxln_change_theme');

function pxln_change_theme($theme) {    
    if ( ! is_user_logged_in() ) {
        $theme = 'waiting';
    }
    return $theme;
}
deleted 47 characters in body
Source Link
pixeline
  • 2.9k
  • 7
  • 34
  • 44
Loading
Source Link
pixeline
  • 2.9k
  • 7
  • 34
  • 44
Loading