How it works...

First, we have to set up an ad using this plugin. We used the Add New button in the ads list to create a new ad. Generally, an ad contains an image and a link to the advertised site. However, the plugin provides several different sample ad codes. These options include link-only ads, iframes, and links with image ads. We selected the ad code with a link and image, as shown in the following code:

<a href="https://www.yoursite.com/" target="_blank"><img src="%asset%" /></a>

Then, we have to update the link to point to the proper URL for the advertisement. The template uses a placeholder called %asset% for the image URL. We need to upload the banner image using the Banner asset setting and the plugin will use the URL of the uploaded image and replace the %asset% placeholder with it. Then, we also enabled Statistics to check how the ad is performing. Then, we set up the start and end date for the ad. Once it's set up, the ad will be visible only within the specified time period.

Finally, we clicked the Save Advert button to create the ad. The plugin will use a custom table called wp_adrotate to store the information for the ads. Also, the scheduled time for each ad is stored in the wp_adrotate_schedule table.

Once the ad was created, we clicked the link to go to the edit screen and find how to use it. We can either use it as a shortcode and display anywhere or display in available sidebars as a sidebar widget. First, we copied the shortcode and added it to a new page. The shortcode will retrieve the ad data from the mentioned custom tables and display the ad on the frontend for the users. We also used the built-in AdRotate widget to place the ad in all parts of the site using the footer widget area.

This is a simple way of adding and scheduling custom advertisements on your site. This plugin also allows us to create a group of ads and a section called Attention so we can view the status of ads. The Attention section shows the errors, expired status, and soon-to-be-expired ads.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset