Splash page in WordPress

I’m starting a WordPress Blog that will have adult content on it, so I’ll need a first-time-only splash page in WordPress. The first-time-only issue, I can fix with a cookie (although I am aware that not everyone has cookies enabled)

What I could do is, create a script that loads another page if a cookie isn’t present. Or I could make the splash page be my home page, and if the cookie is present, redirect.

Read More

But that’s not really what I’m looking for. I don’t want to hassle with pages. In stead I’m looking for a lightbox-y solution, that darkens the background (the home page) and shows a panel with the choice to stay or leave.

I haven’t got a clue on how to start this. I am familiar with PHP, Javascript and CSS, so I’m not even asking for code. I just want a web programmer’s view on this, and some help on how to create the splash-page the way I would like it. Or is it a stupid idea?

Related posts

Leave a Reply

5 comments

  1. I would just create the CSS for it, get it all ready to go, then stick it into the header with your condition. This way, you know that everypage will display it, and you can;t be “caught with your pants down” if you get linked to.

    My only concern would be to make sure that the lightbox effect covers anything graphic, as I’m sure you don’t want it displayed before the user agrees to seeing it.

  2. There shouldn’t be any problems with creating a little bit of JavaScript code that checks a cookie and displays a lightbox if the cookie is not set. The JavaScript can simple display a div with the panel with the choice to stay or leave. And perhaps an other div to dim out the background, but you can do that in any way you see fit.

  3. Use Colorbox and call it onload

    http://jacklmoore.com/colorbox/example1/

    I’m using this to create a popup on load. It sets a cookie to expire every 30 days. Create a div called #inline_content with all your content in it and set it to display: none;

    Hope this helps.

            <script>
    
                    $(document).ready(function() { 
    
                        if (document.cookie.indexOf('visited=true') === -1) {
                           var expires = new Date();
                            expires.setDate(expires.getDate()+30);
                            document.cookie = "visited=true; expires="+expires.toUTCString();
                            $.colorbox({inline:true, width:"40%", height:"450px", href:"#inline_content"});
    
                        }
    
    
                        });
    
                </script>