*

tassonfl

  • ***
  • 50 posts
I'm writing to report a potential bug in the Banners & Advertisement Plugin v2.1.1 regarding its category targeting feature.
The Issue:
I have an advert that is configured in the admin panel to display only in one specific category (e.g., "Books - Magazines").
When I place the banner's hook in my search.php theme file, the advert is displayed correctly when I visit that specific category. However, the advert also incorrectly appears on the main, unfiltered search page (e.g., mysite.com/search), where all categories are shown.
Expected Behavior:
The advert should only be visible when a user is searching within or browsing the specific category assigned to it in the advert's settings. It should not appear on the general search page.

Marked as best answer by frosticek on October 08, 2025, 11:20:10 AM
*

MB Themes

In ModelBA.php

find this code:
Code: [Select]
    if((osc_is_ad_page() || osc_is_search_page()) && (int)$cat_id > 0) {

replace with:
Code: [Select]
    if(osc_is_ad_page() || osc_is_search_page()) {
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

tassonfl

  • ***
  • 50 posts
Work, thank you!