inject ads in categories

Home Forums AdRotate for WordPress General Support inject ads in categories

This topic contains 10 replies, has 2 voices, and was last updated by  Arnan 1 year, 11 months ago.

  • #30675

    Andre Cameron
    Badges:

    Hi Everyone,
    I’m new to the adrotate/wordpress and wondering if I can some help

    I’m working on a site
    dev.torontocityguide.com

    I want to have ads running for specific categories
    e.g. if I were to click on “attractions” it would only post ads for attractions along the top so on and so fourth.

    I’m using wordpress running the theme listables by pixelgrade which they recommended adrotate to use but I’m having no luck.

    Can anyone point me in the right direction TIA

    #30711

    Arnan
    Badges:

    Sounds like you need Post Injection – https://ajdg.solutions/manuals/adrotate-manuals/post-injection/

    #30728

    Andre Cameron
    Badges:

    Hi Arnan and thanks for the help.

    So when using this “listable” theme these categories
    e.g. attractions, outdoors..etc
    aren’t under the ‘post -> categories section’, there actually under a whole different area called “listings -> categories”

    So when I goto adrotate to use post injections. It doesn’t give me any of the categories that I’ve in the (listings -> cartergories area)

    Any idea how I would get to access those?

    Thanks

    #30733

    Andre Cameron
    Badges:

    Sorry is Post injection a separate plugin or do you mean using post injection thats comes with adrotate pro.

    I ask because when looking at the link you sent.
    My screen doesn’t look like that in the adrotate groups setting

    #30745

    Andre Cameron
    Badges:

    So if I goto http://dev.torontocityguide.com/listings-no-map/ it works like it should. but if I come out of the page and click on a link lets say ‘eat and drink’
    it doesn’t display anything.

    #30943

    Arnan
    Badges:

    Post Injection is a feature in AdRotate and AdRotate Pro – As described in the earlier linked page. If you don’t have those features you’re using a 6 year old version of AdRotate (Pro) or a different plugin.

    For the missing adverts, maybe your adblocker is blocking them – Try disabling the adblocker.

    #31139

    Andre Cameron
    Badges:

    Hi Arnan,

    i’ve disabled all adblockers, I’ve recently purchased a copy of AdrotatePro. I do see the section you’ve described in the link, but the categories that I’ve created do not show in the adrotate post injection section.

    Here’s a screenshot of the categories I’ve created:
    <img src="http://dev.torontocityguide.com/banners/2017-06-05.png" alt="categories" />

    Here’s a screenshot of the categories in the post injection section:
    <img src="http://dev.torontocityguide.com/banners/2017-06-05-2.png" alt="post injection" />

    Is there a way to post inject and choose from the (listing categories) and not from the
    posting categories?

    Or Is there a way to directly insert the code into a php page to get the ads to load?

    Thanks

    #31165

    Andre Cameron
    Badges:

    Seeing that Listable creates own category types and it is not possible to target them is it possible to target them with a “URL Parameters” ?

    #31224

    Arnan
    Badges:

    I reread your replies. Looks like some of the things you’re adding are custom post types. Custom post types are not supported – So if your categories and stuff are not there, that’s probably why.

    I’m not sure what you mean with url parameter, but as you probably saw, there is no option for such a thing…

    What you can do, take a look at your theme documentation for that, is to add groups and adverts to your categories in the theme directly by editing the PHP files.
    You may want to use a Child theme for this.

    #31245

    Andre Cameron
    Badges:

    Thanks I think I figured it out, I’m sure if its coded properly, not really good at this stuff, but I went into the taxonomy-listing-category page and inserted the following:

    <?php
       if (strpos($_SERVER["REQUEST_URI"], "/listing-category/attractions/") !== 0): ?>
       <?php echo adrotate_group(2); ?>
    <? else: ?>
    <?php echo adrotate_group(3); ?>
    <? endif; ?>
    #31411

    Arnan
    Badges:

    That may work, WordPress has a bunch of conditional tags that can check your post type and what kind and name it is/has, too.
    Maybe of use: https://codex.wordpress.org/Conditional_Tags

Viewing 11 posts - 1 through 11 (of 11 total)

The topic ‘inject ads in categories’ is closed to new replies.

You may be interested in