Search and sort wont load when i use wordpress theme (brand)

Search and sort wont load when i use wordpress theme (brand)

imakeebbqimakeebbq Posts: 4Questions: 1Answers: 1

I am a total noob when it comes to coding datatables but i figured out how to code the tables using jsfiddle and stuff. Right now when i get the file up locally and not put onto the text editor, the datatable shows all the records and i can sort and search. However it does not display on the brand theme for wordpress and just shows all the tables without any of the scripts on even though they are loaded.

Thanks for your help in advance.

By the way im using the jsfiddle libraries so...


This question has an accepted answers - jump to answer

Answers

  • imakeebbqimakeebbq Posts: 4Questions: 1Answers: 1

    just thought id give an update and say im modifying this part of the website

    https://test-titanium.tk/database/

  • Tester2017Tester2017 Posts: 145Questions: 23Answers: 17
    edited October 2017

    A had a quick look at your page and I saw some minor errors in the html, for example on line 464:

    <p><script>
    $(document).ready(function () {
        initDatatable();</p>
    <p>    // bind row click handler
        bindEventHandlers();
    });</p>
    

    The </p> should not be there (after initDatatable();) and neither the <p> on the next line.

    The same thing on line 771:

    $(document).ready(function () {
        initDatatable();</p>
    <p>    // bind row click handler
        bindEventHandlers();
    });</p>
    

    I don't know if this is causing your problems, as I have not tested it.

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947

    The browser's console shows these errors:

    (index):464 Uncaught SyntaxError: Unexpected token <
    (index):771 Uncaught SyntaxError: Unexpected token <
    

    The first error is here:

    <p><script>
    $(document).ready(function () {
        initDatatable();</p>
    

    Looks like you have <p> tags throughout your script. This is causing the errors and not executing the Datatables init code.

    Looks like you may have other syntax errors. You can run your page through the WC3 Validator:
    https://validator.w3.org/

    Minimally you will need to remove the <p> tags.

    Kevin

  • imakeebbqimakeebbq Posts: 4Questions: 1Answers: 1

    @kthorngren yea i have noticed that as well but for some reason when i delete it, it gets rid of the whole table. ill give it a try tonight and see if it works

  • imakeebbqimakeebbq Posts: 4Questions: 1Answers: 1
    Answer ✓

    Found the answer!! So when you leave whitespace within wordpress it creates those <P> tags. wow thats such a pain >.>

This discussion has been closed.