This is a simple piece of code I wrote myself to give a content warning to visitors about content of the page they’re about to view. If you have pages with adult content, you must warn viewer about content that they’re about to view.
I’m not going to talk about legal and social issues in this post. This code will also come handy if you’re using pop-under or pop-up advertisements on your site. I already told you that I have tested some pop-under advertisements on my adult sites and had good result with Juicy ads (Read Best Pop-up Advertising for Adult Sites). Yesterday I went through my analytics and saw that I had about 3k visits yesterday. But my pop-up count is pretty low. It was about 500 pops for total of 3k visits. The reason is clear. Almost all web surfers have a pop-up blocker software or add-on installed. They block my pops being popping.
I must say that there is no complete solution for this. But it can be controlled a bit if I however get user to click somewhere on my site. Yes, most of the visitors coming to my site don’t view more than one page. It’s an image hosting site. I drive traffic manually. So they don’t stick around for long. They just close the window after viewing first page they land.
What is code does is it hides content of the page with content warning message. If user wants to see hidden content that already loaded in background, he or she needs to click enter button. Warning message will disappear with the click and it’ll also activate pop-up code. So here the code,
First we’ll need good design which will cover the page, paste following code to your css file.
Then we need to call it within the body tag of the theme. Following code will do it. But first find following code within your theme,
And add following code just after it.
[html] <div id="popact">
<center><span>Adult Content Warning!</span></center>
<span style="font-size: large;">##### Replace This with Your Massage #####</span>
The code will give users 2 options, to enter or exist. If user click Enter button, the message will disappear immediately. And if user clicks Exit, he or she will be redirected to kids.yahoo.com. Replace the url on above code to have them redirected to another site.