Support » Plugin: Ad Injection » Ads not showing, probably due to theme

  • Hi, I seem to be having a problem with ads not appearing in posts. The ads appear fine in regular pages, but not in posts. I suspect this is something to do with my theme (Score Theme by at

    1. In “Tick to disable ads” section I did not check anything except for 404 and Search.

    2. When I turned debug mode on, not one ‘ADINJ DEBUG’ appears in the posts, but they appear fine in the regular pages.

    3. No caching plugin
    4. Tried changing the_content filter priority to 100, 200 and 1000. No luck.

    So far, I like what this plugin can do and is perfect for my needs (i.e. no need to insert codes for each and every post, but insertion is more flexible than the other plugins available). Now if I can make it work with my theme I am happy to make a donation to the awesome author!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author reviewmylife


    Hi Nasho, if you see the ADINJ DEBUG tags on pages but not post that suggests that your theme is doing something interesting (or non standard).

    I’m afraid I don’t have time at the moment to look into issues that seem theme specific, but I’d suggest contact the theme author in case he/she does have more time! Good luck ๐Ÿ™‚

    Hi reviewmylife, thanks for the quick reply.

    I’m a bit of a coder myself so I am investigating the files myself. If I understand it right, the ads should be triggered by the line below:

    the_content(__('Read More ยป', 'gp_lang'));

    Is that right? If so, it seems that in the theme I’m using, single.php requires single-review.php (via require_once), then single-review.php calls review-tabs.php via require_once too, and it is in the file review-tabs.php where the line..

    (the_content(__('Read More ยป', 'gp_lang'));) being called.

    So with this setup I guess your hooks are not being triggered. Can you suggest anything I can do myself so that the ads will be triggered by the line from review-tabs.php?

    I replaced the line:

    php require_once('single-review.php');


    the_content(__('Read More ยป', 'gp_lang'));

    ..directly and still, the ads did not display too. So I guess that wasn’t it.

    Hi reviewmylife, I think the Ad injection might not be recognizing the posts page as such, that’s why it treats it as a page to ignore? In the Tick to disable ads section, though, the posts are recognized by Ad Injection as it reflects the number of total posts (e.g. Single(4)). But when the posts are actually being viewed, no ad is showing as I think it is ignoring it. Any idea what variable I can change? I’m really new to WordPress ๐Ÿ˜›

    Plugin Author reviewmylife


    Hi Nasho, it is quite possible that the posts aren’t recognised as standard WordPress posts. Your custom theme might be classifying them as something different. All the logic to decide whether to show the posts or now is in ad-injection.php. The answer might be in there but it is quite a big file. Might be easier to try another plugin (but you may well find the same problem), or try another theme.

    Hi reviewmylife, I narrowed it somewhat to this line in your ad-injection.php:

    if (!in_the_loop()) return $content; // Don't insert ads into meta description tags

    That line is found in function adinj_content_hook($content). If I remove that line, then the ads are showing! ๐Ÿ™‚ So I’m getting there.

    So this means the theme I’m using is doing something which makes your plugin think that it’s somewhere in the meta description tags section, or it has something to do with it.

    You got any idea what I could change in the theme? I mean, I can remove that line from your plugin but it might have consequence like the ads will be inserted into meta description tags.

    Plugin Author reviewmylife


    Hi Nasho, thank for that – it is interesting information. The main post content should be inserted whilst in the ‘WordPress loop’. I’d suggest you contact the theme author and ask why this isn’t the case.

    You could also look at the WordPress default themes and you’ll see what they do to insert content in the loop.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Ads not showing, probably due to theme’ is closed to new replies.