Best method to show modal only once

There is no best practice here, and to be really honest, cookies are your best (and probably only) option here. The issue with visitors are that they are only visitors. If they were first time signup members and you would want to show something to them only once when they are done registering, the best … Read more

Where is function to prevents non logged users access wp-admin?

You will need to use the authenticate filter: https://codex.wordpress.org/Plugin_API/Filter_Reference/authenticate add_filter( ‘authenticate’, ‘myplugin_auth_signon’, 30, 3 ); function myplugin_auth_signon( $user, $username, $password ) { return $user; } Return a WP_Error object to indicate failure or an issue, or a WP_User object on success. There are also 2 core functions hooked into that filter that will need removing … Read more

Showing different pages depending on a cookie value

You could hook into the template redirect function. function my_page_template_redirect() { if ( isset( $_COOKIE[“myCookie”] ) ) { if( $_COOKIE[“myCookie”] == “en” ) { wp_redirect( ‘you path’ ); exit; } } } add_action( ‘template_redirect’, ‘my_page_template_redirect’ ); And you could better use wp_redirect() function to redirect inside WordPress.

cookie free subdomain and @font-face

@font-face does not require cookies (unless you choose to cache fonts to avoid server hits), and having a subdomain will make no difference either. You may therefore have an issue with your URLs. Your paths in the first (multiple-line) example are relative to your css file; is your ‘fonts’ directory in the same directory as … Read more

How to set cookies

You use setcookie() like any other function, with parameters as described in the Codex. How you would use it in a form would usually depend on how and when the $_COOKIE variable needs to be made accessible. One common method, if you want a change in the DOM both to register immediately and to persist, … Read more

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