• Resolved cristoto

    (@cristoto)


    Yesterday, my snippets work without problems. But, today only work if the user is login into wordpress.

    The problem is that I need the snippets work when the user is logout.

    Can anybody help me?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 16 through 20 (of 20 total)
  • Thread Starter cristoto

    (@cristoto)

    I tried use “Run everywhere” but not work.

    The code only work when customer send form.
    Now you see that the screen appear empty when login with the test user.
    But the cookie isn’t storage and the header redirection don’t work.

    I put a some var_dump() to see that the code enter into conditional and show when execute each function.

    • This reply was modified 5 years, 9 months ago by cristoto.
    • This reply was modified 5 years, 9 months ago by cristoto.

    You need to make sure that all PHP code is executed in the snippet Everywhere. And you can output the form using a shortcode.

    Also, don’t forget to abort the script exit(); after calling header()

    Thread Starter cristoto

    (@cristoto)

    I did it. I have the same problem with an authorizate user in wordpress work but with I unauthorizate user don’t.

    Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/themes/Avada/header.php:14)
    I see this message on your site. So the theme outputs something earlier. Try executing the code using a hook:

    add_action('init', function(){
     //your php code
    })

    http://collabedit.com/44wfv

    • This reply was modified 5 years, 9 months ago by Temyk.
    Thread Starter cristoto

    (@cristoto)

    I tried but not work.

    I think the warning isn’t the problem because with an authorize user (login into wordpress) the same code work. If I login with authroize login warning disappear.

Viewing 5 replies - 16 through 20 (of 20 total)

The topic ‘Code not working logout’ is closed to new replies.