Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor WPManageNinja

    (@wpmanageninja)

    Thread Starter Mayank Majeji

    (@mayankmajeji)

    It’s not working. The style is still enqueuing. Is there any other method?

    Thread Starter Mayank Majeji

    (@mayankmajeji)

    I’ve tried the code with two different themes. It doesn’t work with either of them.

    Plugin Contributor WPManageNinja

    (@wpmanageninja)

    Please try the following gist:

    https://gist.github.com/techjewel/1b62aff84b5d18560379d71b5343241f

    Please note that, if you dequeue_script then the table may not load.

    Thread Starter Mayank Majeji

    (@mayankmajeji)

    Hello!

    I completely understand that. That’s why I have removed the following scripts which are responsible for table loading –

    wp_dequeue_script( “footable” ); // Remove the Footable Library
    wp_dequeue_script( “footable_init” ); // Remove the Custom Scripts

    However, the code is working perfectly fine for javascript, but not for style.

    Style is still getting enqueued even after lowering down the action priority and wp_print_styles hook.

    I don’t see any reason to act it like this as the code is absolutely correct. but unfortunately its not removing the styles.

    Thread Starter Mayank Majeji

    (@mayankmajeji)

    I also cross-checked if there is any cache issue, but that’s not the case as well.

    Plugin Contributor WPManageNinja

    (@wpmanageninja)

    Then just use the following script:

     add_action( 'wp_print_styles', function() {
                wp_dequeue_style( "footable_styles" ); // Remove The Syyles        
        }, 100 );
    Thread Starter Mayank Majeji

    (@mayankmajeji)

    Well, that worked like a charm. Thanks a lot, mate.

    I did use the same code earlier but inside another action – wp_enqueue_scripts.

    Thanks again. Have a good day 🙂

    Thread Starter Mayank Majeji

    (@mayankmajeji)

    Wait! it is not completely removed. It now appears at the footer after the Ninja Tables Custom JS Code.

    Thread Starter Mayank Majeji

    (@mayankmajeji)

    Hi!

    I just removed it.

    It seems it was getting added from 2 different sources.

    So I have added 2 code snippets which completely avoid the enqueue of ninja tables styles. Phew!

    add_action( “ninja_table_before_render_table_source”, function () {
    wp_dequeue_style( “footable_styles” ); // Remove The Syyles
    wp_dequeue_script( “ninja-tables-pro” ); // Remove Pro Version Script. It does not load always.
    wp_dequeue_script( “jquery.stickytableheaders” ); // Remove the stickytableheaders it does not load always

    }, 100 );

    add_action( ‘wp_print_styles’, function() {
    wp_dequeue_style( “footable_styles” ); // Remove The Syyles
    }, 1 );

    Thanks a lot for your help.

    Thread Starter Mayank Majeji

    (@mayankmajeji)

    Hi!

    I successfully removed the styles, but here comes another issue.

    When I removed the styles and checked the mobile version of the table generated by Ninja tables. It looks like this – https://screenpresso.com/=Oy5uc.

    It will strictly affect SEO as search it’s not the correct hierarchy of the table.

    I am using stackable mode for mobile devices. Can you help me removing the extra table header?

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Dequeue Ninja Tables Public CSS File’ is closed to new replies.