WP Manifestindependent plugin directory
manifest / forms / jl-ads

JL Ads

Simple ad custom post type for WordPress

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/phoopee3/jl-ads/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

A WordPress plugin that ads a custom post type for an Ad.

When creating a new ad:

  • Add three versions of the ad
    • Desktop
    • Tablet
    • Mobile
  • The form includes:
    • Image: shows the media library so you can upload or pick an existing ad
    • URL to link to
    • Target (self or new window)
  • Outside of the 3 versions of the ad, it has a meta box that lets you set the dates for the ad to run, it has three options
    • Always running
    • Start date
    • End date

The way the ad is shown is via a shortcode, like [jl-ad id=123]. This shortcode is be shown in a metabox after the ad is published. There is a button next to the shortcode text to copy it to the clipboard.

On the frontend, when the shortcode is called, it first determines if the ad should be shown based off the date. If it should be shown, then it will show all three ads (hidden) but then toggle the visibility of the appropriate ad based off what the current browser width is. It also listens for when the window changes size, and toggles the ad appropriately.