• Resolved Влад

    (@novichok78)


    Hello. The mobile version of the site displays an empty ad block. Although it is set in the settings only for display in the computer version. How do I hide this block?

    I attach a screenshot: https://dropmefiles.com/rERLe

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Spacetime

    (@spacetime)

    Hello,

    you need to enable (client-side insert) device detection and then enable only wanted devices:
    https://adinserter.pro/documentation/device-detection

    You can use debugging function Label blocks to see which block is inserted and where:
    https://adinserter.pro/documentation/device-detection

    Thread Starter Влад

    (@novichok78)

    It doesn’t help

    Plugin Author Spacetime

    (@spacetime)

    Can you please calrify which block (number) you are referring to?

    Thread Starter Влад

    (@novichok78)

    3. as a widget on the sidebar

    Plugin Author Spacetime

    (@spacetime)

    Could not reproduce any issue.

    Block 3 is not shown for tablet and phone devices – as configured.
    БЛОК ВСТАВЛЕНО, НО НЕ ВИДИМО

    What you see is not block 3 but the widget padding around a hidden block generated by the theme.
    Need to check how this can be hidden.

    Thread Starter Влад

    (@novichok78)

    the block is displayed as an empty white block

    Скриншот https://dropmefiles.com/Mw8mH

    Thread Starter Влад

    (@novichok78)

    another widget is not displayed with the same settings

    Plugin Author Spacetime

    (@spacetime)

    As explained the block is not displayed – it is hidden.

    You can check the page source code to see what is there – this is widget padding around empty widget – the block is inserted but hidden for mobile devices.

    You can also use debugging function Label blocks to see where the blocks are:
    https://adinserter.pro/documentation/debugging

    Since you are using client-side device detection the widget is always inserted as the device is not known when the page is created.

    Try to insert an empty block (only for mobile devices) inside HTML element #block-16 – Action Replace element to get rid of this padding:
    https://adinserter.pro/documentation/insertion-before-inside-after-html-element

    Plugin Author Spacetime

    (@spacetime)

    another widget is not displayed with the same settings

    Can’t compare settings unless you list block number.

    Thread Starter Влад

    (@novichok78)

    5

    Plugin Author Spacetime

    (@spacetime)

    There is a difference.

    Block 5 is inserted as a pure Ad Inserter widget and consequently when it is hidden the code tries to hide also the widget itself – and here it is hidden.

    However, block 3 doesn’t seem to be inserted as a pure Ad Inserter widget – there is some dynamically added code around the block which prevents the widget form being hidden:

    <div id="block-16" class="sidebar-box widget_block clr">
       <div class="wp-block-group">
          <div class="wp-block-group__inner-container">
             <div class="wp-block-columns">
                <div class="wp-block-column" style="flex-basis: 100%; position: sticky; top: 7243.23px;">
                   <div class="widget ai_widget ai-viewport-1 ai-sticky-widget" style="">
    
                      AD INSERTER BLOCK 3 CODE
    
                   </div>
                </div>
             </div>
          </div>
       </div>
    </div>
    

    It seems that you are using some plugin for sticky widgets that adds this extra widget code.
    Maybe CSS mode for Ad Inserter sticky widgets may work with your theme:
    https://adinserter.pro/documentation/manual-insertion#widgets

    In any case you can try to use the approach described in the post above (you may need to add some insertion delay e.g. 100 ms or wait for the element #block-16).

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How to hide an empty block’ is closed to new replies.