This documentation will show you how to take any ViralSweep sweepstakes template and integrate it into your Wordpress site site.

Sites and blogs hosted on WordPress.com cannot use ViralSweep because they block JavaScript. This documentation is only for self-hosted WordPress sites.

Full Page | Widget | Lightbox

Integrate the Full Page Template

These steps will show you how to integrate the full page giveaway style into your Wordpress site.

In order for the full page to properly function on WordPress, you will need to add the code to a blank HTML file and upload it via FTP. This file will not contain your site template such as your navigation or footer. Skip to the section for integrating the widget if you want your site template to display around the giveaway.

1) Create the sweepstakes file

Navigate to your ViralSweep dashboard, click 'Get Code' on your giveaway, and copy the code for the full page. Paste the code for the full page giveaway onto a blank HTML file. Save the file with any name you would like, using the .html extension. For this demo, we've named our file 'index.html'.

2) Connect via FTP

Now you will want to connect to your site via FTP. There are a variety of programs you can use to connect via FTP. For this example, we'll be using FileZilla.

Once connected, you will want to navigate to where your WordPress site files are located.

3) Create a director

Create a new directory where your other WordPress directory files are. For this example, we're going to name our directory 'giveaway'.

4) Upload the file via FTP

Double click on the new directory you created, and then drop in the HTML file you created containing the ViralSweep code.

5) You're done!

To preview your giveaway, you will need to navigate to the URL of where it was uploaded.



Integrate the Widget Template

These steps will show you how to integrate the widget into your Wordpress site.


1) Copy the widget code

Navigate to your ViralSweep dashboard, click 'Get Code' on your giveaway, and copy the code for the widget.

2) Go to your Wordpress admin panel

Navigate to your WordPress admin panel and choose which page, or which post you want to add the widget to.

3) Paste the code in the text editor

Paste your code into the text editor, NOT into the visual editor.
If you paste your code into the text editor, then switch over to the visual editor, it will break the code. You must paste it into the text editor and save or publish the post.


4) Hit publish or save

Once you paste in your code, hit publish or save and view your page. You should see the widget show up. That's it, you're done!


Troubleshooting

If you have pasted in your widget code and it is not showing up, these are the most common reasons as to why:

Code pasted into Visual Editor
You pasted the code into the visual editor and not the text editor. The code must be pasted into the text editor only.
Switched to Visual Editor
You pasted the code into the text editor, then switched over to the visual editor. Switching to the visual editor will break the code. You must go back to the text editor, remove the code and paste it back in.
Refresh the preview or publish post
You pasted the code into the text editor and then tried to preview the post and the widget doesn't show up. In order to see the widget, you'll have to either refresh the preview page several times or publish the post.
Wrong user role
Your user role must be set to either an admin or an editor in order for the widget to show up. If you do not have one of these user roles, you will not see the widget.


Integrate the Lightbox Template

These steps will show you how to integrate the lightbox into your Wordpress site.


1) Copy the lightbox code

Navigate to your ViralSweep dashboard, click 'Get Code' on your giveaway, and copy the code for the lightbox


2) Go to your Wordpress admin panel

Navigate to your WordPress admin panel and choose which page, or which post you want to add the lightbox to.


3) Paste code into the text editor

Paste your code into the text editor, NOT into the visual editor.
If you paste your code into the text editor, then switch over to the visual editor, it will break the code. You must paste it into the text editor and save or publish the post.

4) Hit publish or save

Once you paste in your code, hit publish or save and view your page. You should see the lightbox show up. Keep in mind that the lightbox functions on cookies, so if you're not seeing it, try viewing the page in a different browser. That's it, you're done!

If you've added the lightbox code and you are not seeing it when you view the page, it may be because you've already seen the lightbox previously. The lightbox will place a cookie and once you've seen it, it won't display again. To view it, simply open a different browser or view the page in private browsing or incognito mode and you will see it.
Still having trouble with adding your sweepstakes to Magento? Simply click the support or live chat icon to get in touch with us.