Remove ads from custom post type

Posted in: Newspaper
Post count: 2

Hello,

I use a recipes plugin (Cooked) which uses a CPT. In the Newspaper theme I am using the Article Inline Ad but it doesn’t display nicely alongside recipes (I like it on all other posts though). Is there a way that I can stop these ads displaying in the recipe CPT?

Example recipe. Note the ad displays amongst the ingredients.

Thanks,
Alex

Post count: 20688

Hi,

From what I can see you are using an article bottom ad – https://www.screencast.com/t/X4T5Ljr31hQI and it does not interfere with your custom post type – https://www.screencast.com/t/DT9z5gmSA Unfortunately it would not be easy to remove these ads just for this custom post, because they are part of the post content and will display in all the post templates when an ad code is inserted in the article ad field (top ad, inline ad and bottom ad)

Thanks

Post count: 2

Apologies, I posted this and then continued to try and find a work around. Incidentally, I stumbled across a method that appears to work. I’m no expert, so I’m not sure if this is a good way of doing things.

This is the way it was looking before https://www.screencast.com/t/rcTno6qHTbux.

  • I created a new template for the recipes CPT following your instructions https://forum.tagdiv.com/custom-post-type-support/.
  • I then added a css class (td-recipe) to the container div of that template.
  • and created a new style to not display the advert
  • .td-recipe .td-a-rec-id-content_inlineright {
    float: right;
    display: none;
    }

    Which results in it looking like this https://www.screencast.com/t/Iy42eWMfp1Z6. It appears to be working ok.

    Again, apologies for not updating the post once I had done this. Thanks for looking into it for me nonetheless.

    Post count: 20688

    Hi,

    No problem, glad you could manage to find a solution that works for you.

    Thanks

    Viewing 4 posts - 1 through 4 (of 4 total)
    The forum ‘Newspaper’ is closed to new topics and replies.