The Custom Position placement that comes with Advanced Ads Pro is great if there isn’t any other pre defined placement for the position where you want to inject your ad into. The best part of it is the frontend picker that allows you to select the position of the ad without any coding.
This placement also allows you to place a new HTML tag where the ad should show up. This is useful when you want to target positions that are defined within your theme options and allow you to enter custom HTML.
The Custom Position Placement has two modes:
1. Place the ad near existing elements using the element selector
(Covered in the video above)
- Enable this mode and click on the select position button, which will forward you to the frontend of your website.
- Use left click to select the position on non-clickable elements and right click to select clickable elements like links. You can use left click on links if you want to navigate on your site.
- Once an element is selected, you should be forwarded to the placement page again and the selector should be written into the appropriate field.
- Select the position in which the ad should appear in relation to the selected element.
2. Use a new HTML element to place the ad
(Not covered in the video above)
- Simply select this option and copy the HTML code from the field. You can place it anywhere, where HTML is rendered, e.g. in a text widget, page, or theme options.
Here are some things to keep in mind when using the Custom Position placement:
The element picker works with all modern browsers and with Internet Explorer (IE) 11 and higher.
When using this placement, the ad will be injected into the page footer and then moved to the position you picked. If the parent element is not available, the ad will stay in the footer or not be loaded in case passive cache-busting is enabled. Use Display Conditions in order to remove the ad from any pages where your parent element is not displayed.
The ad will appear as often as there are visible elements with the same selector. E.g., if you just use h2 , then the ad would show up close to every h2 headline. This is not a bug, but a feature. If you only want to show the ad at a specific element, use a unique selector (e.g. with an ID)
Moving the ad to the right position might also fail after you changed or updated your theme.
Debugging invisible or wrong positions
If your ad does not show up (or shows up in the page footer) or is placed in a strange position, it might be because of a wrong element selector.
Please check if there are no individual identifiers in the element selector.
main#main > article#post-379
main#main > article
This fix is needed because the “#post-379” selector does only exist in posts with the ID 379. You will notice similar individual selectors by specific numbers or names that indicate that they might not match every page where you want to display the ad.