*

umimo

  • ***
  • 88 posts
Hide premium ads by category
« on: January 13, 2023, 10:20:34 AM »
Hi,

How to hide premium ads in selected category

<?php if(bet_param('premium_home') == 1 && osc_count_premiums() > 0) { ?>
    <div class="home-container premium">
      <div class="inner">

        <!-- PREMIUMS BLOCK -->
        <div id="premium" class="products grid">
          <h2><?php _e('Featured listings', 'indie'); ?></h2>

          <div class="block">
            <div class="prod-box">
              <?php $c = 1; ?>
              <?php while( osc_has_premiums() ) { ?>
                <?php bet_draw_item($c, true); ?>

                <?php $c++; ?>
              <?php } ?>

              <?php if(osc_count_premiums() <= 0) { ?>
                <div class="home-empty">
                  <img src="<?php echo osc_current_web_theme_url('images/home-empty.png'); ?>" />
                  <strong><?php _e('No premium listing yet', 'indie'); ?></strong>
                </div>
              <?php } ?>
            </div>
          </div>
        </div>
      </div>
    </div>
  <?php } ?>

*

MB Themes

Re: Hide premium ads by category
« Reply #1 on: January 16, 2023, 03:40:07 PM »
Update this line:
Code: [Select]
<?php if(bet_param('premium_home') == && osc_count_premiums() > 0) { ?>

into following:
Code: [Select]
<?php if(bet_param('premium_home') == && osc_count_premiums() > && !in_array($search_cat_id, array(1,2,3,4,5))) { ?>

Note that $search_cat_id should be defined before (and probably is in standard theme code).
array(1,2,3,4,5) specifies categories where premium block is hidden.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots