Forum Replies Created

Viewing 1 replies (of 1 total)
  • I have found that issue is coming from cookie.
    Please set a cookie in functions.php file with project path
    in this after set of cookies page will reload without changing web URL
    Set this code in footer of wordpress

    e.g
    add_action( ‘wp_footer’, ‘mycustom_wp_footer’ );
    function mycustom_wp_footer() {
    <script type=”text/javascript”>
    function getCookie(name) {
    var value = “; ” + document.cookie;
    var parts = value.split(“; ” + name + “=”);
    if (parts.length == 2) return parts.pop().split(“;”).shift();
    }
    var accept = getCookie(“humans_21909″);
    if (accept !=”1”) {
    document.cookie = “humans_21909=1; path=/insert here project root path/”;
    console.log(“ok”);
    (function()
    {
    if( window.localStorage )
    {
    if( !localStorage.getItem(‘firstLoad’) )
    {
    console.log(“refresh”);
    localStorage[‘firstLoad’] = true;
    window.location.reload();
    }
    else
    localStorage.removeItem(‘firstLoad’);
    }
    })();
    }
    </script>
    }

    I think your issue will resolve with this

    • This reply was modified 5 years, 9 months ago by sudarshant.
Viewing 1 replies (of 1 total)