Dequeue Ninja Tables Public CSS File
-
Is it possible to dequeue ninja tables public CSS?
-
It’s not working. The style is still enqueuing. Is there any other method?
I’ve tried the code with two different themes. It doesn’t work with either of them.
Please try the following gist:
Please note that, if you dequeue_script then the table may not load.
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 ScriptsHowever, 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.
I also cross-checked if there is any cache issue, but that’s not the case as well.
Then just use the following script:
add_action( 'wp_print_styles', function() { wp_dequeue_style( "footable_styles" ); // Remove The Syyles }, 100 );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 🙂
Wait! it is not completely removed. It now appears at the footer after the Ninja Tables Custom JS Code.
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.
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?
The topic ‘Dequeue Ninja Tables Public CSS File’ is closed to new replies.