Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter MrYess

    (@mryess)

    Filter Plug-in – Filter Everything

    Plugin Author Phil

    (@philsbury)

    Hi @mryess,

    These are two different categories aren’t they – they have different IDs? You would need to set each to be restricted in the admin settings.

    Thanks
    Phil

    Thread Starter MrYess

    (@mryess)

    No! One category ID . First – category link , and two – filtering link. (I’m choose this is category on filter)

    • This reply was modified 3 years, 2 months ago by MrYess.
    • This reply was modified 3 years, 2 months ago by MrYess.
    Thread Starter MrYess

    (@mryess)

    On category page your plug-in work. If chose category in filter , your plug-in don’t work (

    Thread Starter MrYess

    (@mryess)

    Parent category – https://memshop.ru/shopping/podarki/

    https://ibb.co/30KRN2d

    https://ibb.co/yfGtzYd

    • This reply was modified 3 years, 2 months ago by MrYess.
    Plugin Author Phil

    (@philsbury)

    Hi @mryess,

    From the data I can see:
    podarki/category-18 is ID 15
    podarki/18 is ID = 325

    Your second screenshot indicates this is hidden.

    If you are unable to restrict this, add this to your functions.php file:

    
    add_filter('wp_footer', function () {
        ?>
        <script>
            var value = ('; '+document.cookie).split('; age_gate=').pop().split(';')[0] || 0;
    
            window.addEventListener('load', function(){
                if (age_gate_params.misc.i === 15) {
                    if (value < age_gate_params.settings.age) {
                        AgeGate.show();
                    }
                }
            });
        </script>
        <?php
    }, 1000);
    

    This will fire age gate on a taxonomy with an ID of 15.

    Thanks
    Phil

    • This reply was modified 3 years, 2 months ago by Phil.
    Thread Starter MrYess

    (@mryess)

    Code paste. earned in another category )))
    There – https://memshop.ru/shopping/podarki/category-clothes/

    Plugin Author Phil

    (@philsbury)

    Hi @mryess,

    Hmmm.

    Remove that then and replace it with:

    
    add_filter('wp_footer', function () {
        ?>
        <script>
            var value = ('; '+document.cookie).split('; age_gate=').pop().split(';')[0] || 0;
    
            window.addEventListener('load', function(){
                if (window.location.pathname.match('category-18')) {
                    if (value < age_gate_params.settings.age) {
                        AgeGate.show();
                    }
                }
            });
        </script>
        <?php
    }, 1000);
    

    Now we look for category-18 in the url. Still not foolproof but should only show on that hopefully. Be sure to clear WP Rocket cache after changing it.

    Thanks
    Phil

    Thread Starter MrYess

    (@mryess)

    Ok ?? this work ?? thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Don’t work on filter’ is closed to new replies.