Hi,
thanks for your question, and sorry for the trouble.
I’m not sure which select field you mean here. Can you please post a link to the page with the table where this problem happens, so that I can take a direct look? Thanks!
Regards,
Tobias
The select field that shows x number of entries just above table on left http://cranlana.org.au/advanced-symposia/
Hi,
ok, I see. I’m sure what the JS library can help with on that select box, but from what I can see, you’ll need to make sure that it runs after the DataTables JS.
For that, you could maybe experiment with running your code after a short delay (using setTimeout in your JS code), or by enqueuing it in the hook wp_print_footer_scripts with a priority bigger than 11.
Regards,
Tobias
This is the code I used if anyone finds helpful…
add_action( 'wp_print_footer_scripts', 'selectjs_table', 12 );
function selectjs_table() {
?>
<script>
jQuery(document).ready(function($) {
$('.dataTables_length select').selectize({
create: true,
sortField: 'text'
});
});
</script>
<?php
}
Hi,
nice! Good to hear that you found a solution!
Best wishes,
Tobias