• Resolved moisb

    (@moisb)


    hello, what is the proper way to prevent the WP MEteor from loading in custom post type pages? These pages of my theme have a modal (by Semantic UI – https://semantic-ui.com/modules/modal.html) that should open automatically when loading the page, however and obviously, as WP Meteor prevents this (I use the setting until first interaction) the modal only opens when the user does something on the page.

    I want to know how to use the conditional
    if ((is_singular('customposttype'))

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Aleksandr Guidrevitch

    (@aguidrevitch)

    Meanwhile, you can try to add the following code somewhere in your functions.php

    add_filter('wpmeteor_enabled', function ($enabled) {
        if ((is_singular('customposttype')) {
            return false;
        }
        return $enabled;
    });
    
    Thread Starter moisb

    (@moisb)

    thank you Aleksandr. To contribute, knowing this filter I took the opportunity to search the WordPress documentation and I saw that it is also possible to make an array to add other types.

    add_filter('wpmeteor_enabled', function ($enabled) {
       if ( is_singular(array('mycustomposttype', 'page')) ) {
            return false;
        }
        return $enabled;
    });

    in the future it might be interesting to add this as an option in the plugin settings ?? I believe it very useful to have as an option for users with less knowledge, as the benefit of WP Meteor is essential on indexable pages for SEO, but in my view it is not worth it on non-indexable pages and if the user is logged in

    • This reply was modified 3 years, 9 months ago by moisb.
    • This reply was modified 3 years, 9 months ago by moisb.
    Plugin Author Aleksandr Guidrevitch

    (@aguidrevitch)

    Hi @moisb,

    I totally agree with you, and this functionality is on my todo list. It is just that building a good solution, similar to ACF page selectors, requires quite a bit of time, I will definitely add that functionality once I address most of the bugs )

    WBR,
    Alex

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to prevent (unload) wp meteor from working in custom post (singular)?’ is closed to new replies.