Code Generator

This article provides a detailed explanation of each setting found in AdContent > Code Generator.

Screenshots

Default Settings

Settings Type

Select the type of settings. You can select the following options:

  • Default. In this mode, only the basic settings are available. This mode is recommended for most users.
  • Advanced. In this mode, all settings are available. This mode is for advanced users only.

Reset Settings

Turn on this setting and save the settings to reset all fields in the Code Generator. It can be useful when you generate a new code to display ads.

Shortcode / HTML Shortcode / JavaScript Code / PHP Code

Use this code to display ads on the site. You can use this code in the post content, widgets, themes and plugins.

Number of ads

Enter the number of ads to receive. Set -1 to receive all ads.

CSS Classes

Enter space-separated CSS classes for the container of ads. Leave this field blank to disable the container.

Sort order

Select a sort order for the ads. You can sort ads by:

  • Priority.
  • Randomly.
  • Date.
  • Date modified.
  • Included IDs.

Order

Select a sort direction. You can select the following options:

  • ASC (ascending order).
  • DESC (descending order).

Ajax

Turn on this setting to enable Ajax for the shortcode.

Timeout

Enter the number of milliseconds to set the timeout for the Ajax request.

Ad Groups

Select ad groups to receive ads assigned to the selected ad groups.

Ad Formats

Select ad formats to receive ads assigned to the selected ad formats.

User Roles

Select user roles to display ads only to users with the selected roles.

Include Ads

Select the ads you want to include in the query. If you use this field, the generated code will receive the selected ads regardless of the settings selected.

Exclude Ads

Select the ads you want to exclude from the query.

Default Ads

Select the ads you want to receive by default (if there are no relevant ads).

Advanced Settings

These fields are available only in advanced settings mode and are intended for advanced users only. If you set any of these fields, this will disable the automatic detection of the corresponding parameter, and the plugin will use the value you specified. For example, if you select “Mobile” in the “Device Types” field, the generated code will always display ads for mobile devices, regardless of what type of device is actually used. Keep this in mind when working in advanced settings mode.

Countries

Select the countries for which you want to receive ads.

Device Types

Select the types of devices for which you want to receive ads.

Post ID

Enter the ID of the post for which you want to receive ads.

Taxonomy Term ID

Enter the ID of the taxonomy term for which you want to receive ads.

Page Types

Select the types of pages for which you want to receive ads.

Found a spelling error? Select it with your mouse and press Ctrl + Enter