[Resolved] Intro page showed just one time

Home Forums Support [Resolved] Intro page showed just one time

Home Forums Support Intro page showed just one time

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #112110
    maurizio elvetico

    Hi Tom
    I have made a static intro page with a specific template. I want show it just one time. I have add at the beginning of the template the following code:

    <?php
    if(! $_COOKIE[‘visited’]) {
    setcookie(“visited”, ‘1’);
    }
    else {
    header(‘Location: http: //mysite/?page_id=2’);
    }
    ?>

    It isn’t work as the cookie is always true also if I reset the cookies in my firefox.
    In which way Cookies work in wordpress?
    Can you give me some advice?

    thanks a lot

    #112172
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    This plugin looks like it may do what you want: https://wordpress.org/support/plugin/redirect-to-welcome-or-landing-page

    #112201
    elma

    Hi Tom
    Thank you for your quickly reply, but the redirect plugin doesn’t work on my site too.
    The code in the plugin is the same of the mine.
    As I told the $_COOKIE(‘visited’) is always set.
    Perhaps it has to reset when all is starting ?. For example, it must be reset in the wp-head hook (by GP-hook)? and why?
    Now I’m testing in local to understand more.

    #112213
    Tom
    Lead Developer
    Lead Developer

    The plugin I linked to would most likely set a different cookie name.

    Are you sure you have cookies enabled in your browser?

    I just tested that plugin and it worked well for me – no need to do anything to wp_head.

    I installed it and went to “Settings > Redirect to landing page”.

    I entered my URL to redirect to, and set it to “All pages”.

    Next time I tried to visit the site, I was redirected to that page.

    #112285
    elma

    Hi Tom
    I have resolved. The problem is on the way to work.
    From the dashboard it takes little to enable cookies for example simply going on edit page or when I am in GP-Customise. It was necessary to close the panel and restart the browser.
    I am satisfied with the choice GP
    thank you very much

    #112357
    Tom
    Lead Developer
    Lead Developer

    Happy I could help! 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.