Automatically Log Out UserX when visiting WooCommerceStore

You should use one of the actions that occur after parse_query, because then the variables on which the conditional tags are based are set. Such action can be template_redirect. The conditional tag will allow you to check if the current page is a store page. To log out the user, use the wp_logout() function. add_action(‘template_redirect’, … Read more

How to save history in the client’s browser without login? [closed]

You can use cookie to store information in the visitor’s browser. In your single post template, you can set the cookie by using setcookie( ‘last_post_id’, get_the_ID() ); And on your other page, you can manage the last post that the user has visited. $last_post_id = ! empty( $_COOKIE[‘last_post_id’] ) ? $_COOKIE[‘last_post_id’] : false; if( $last_post_id … Read more

set cookies on certain page only

Please try to create certain page template and set cookies <?php /* Template Name: Certain Page */ setcookie(‘my_cookie’, “hello”, (time()+3600), “https://wordpress.stackexchange.com/”); get_header(); ?>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)