WordPress.org

Ready to get started?Download WordPress

Forums

Ad Injection
Custom post types (5 posts)

  1. KyleGM
    Member
    Posted 1 year ago #

    Hi, great plugin.

    Any chance of adding filtering for custom post types?

    Thanks!

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

  2. reviewmylife
    Member
    Plugin Author

    Posted 1 year ago #

    Hi KyleGM, This is a good idea and I've put it on my future list. In the mean time you could use one of the other filtering methods to prevent ads from appearing on those pages (filter by categories, tags, id).

  3. kurdi
    Member
    Posted 1 year ago #

    Is this any close to implementation? Thanks.

  4. reviewmylife
    Member
    Plugin Author

    Posted 1 year ago #

    Unfortunately not :( Right now I don't have any time to work on the plugin. It is possible that I might much later in the year, but I can't make any promises.

  5. kurdi
    Member
    Posted 1 year ago #

    Ok, for those who are interested, I found an easy way to do it, by adding a conditional around the ad code.

    Note that I am using this inside a post, not the loop. As follows

    <?php if(!is_singular('question')): ?>
    <ad code>
    <?php endif; ?>

    In this case above, it checks to see if the post type is not 'question'
    and serves the ad.

    If you wanted the opposite, use
    <?php if(is_singular('question')): ?>
    <ad code>
    <?php endif; ?>

    If post type is 'question', serves the ad. The difference is the absence of a single exclamation (!)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic