WordPress.org

Ready to get started?Download WordPress

Forums

Ad Injection
Ads not showing, probably due to theme (8 posts)

  1. nasho
    Member
    Posted 1 year ago #

    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 ghostpool.com at http://themeforest.net/item/score-review-wordpress-buddypress-theme/703127

    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!

    http://wordpress.org/extend/plugins/ad-injection/

  2. reviewmylife
    Member
    Plugin Author

    Posted 1 year ago #

    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 :)

  3. nasho
    Member
    Posted 1 year ago #

    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'));)

    ..is 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?

  4. nasho
    Member
    Posted 1 year ago #

    I replaced the line:

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

    with:

    the_content(__('Read More »', 'gp_lang'));

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

  5. nasho
    Member
    Posted 1 year ago #

    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 :P

  6. reviewmylife
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  7. nasho
    Member
    Posted 1 year ago #

    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.

  8. reviewmylife
    Member
    Plugin Author

    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.