• Please help! I know some coding, but clearly not enough to figure out how/where to fix this. Every time I open a page with a table, I always get the error: “DataTables warning…cannot reinitialise DataTable.” I’ve tried several browsers and I always get the same error. I already understand this means the site is initialising the same DataTable twice, but that’s when I get stuck.

    I’ve spent many hours researching how to fix this, but I can’t get a clear answer. I’m trying to create a searchable table for our club’s members.
    The test page is https://redwoodwriters.org/datatable-test-pg/

    I have already found some solutions, but I don’t know which plugin file I should update to fix the following:

    <script type=”text/javascript”>
    jQuery(document).ready(function($){
    $(‘#tablepress-1’).dataTable({“order”:[],”orderClasses”:false,”stripeClasses”:[‘even’,’odd’],”pagingType”:”simple”});
    });
    </script>
    </body>
    </html></div></div></div><script type=”text/javascript”>
    jQuery(document).ready(function($){
    $(‘#tablepress-1’).dataTable({“order”:[],”orderClasses”:false,”stripeClasses”:[‘even’,’odd’],”pagingType”:”simple”});
    });
    </script>

    ~~~~~~~~~~~~~~~~

    Again, I understand this means the site is initialising the same DataTable twice. Now, what?

    Some of the solutions I have found include:

    $(‘#example’).dataTable( {
    paging: false
    } );

    $(‘#example’).dataTable( {
    searching: false
    } );

    ~~~~~~~~~~~~~~
    $(‘#example’).dataTable( {
    paging: false,
    searching: false
    } );
    $(‘#example’).DataTable( {
    destroy: true,
    searching: false
    } );
    ~~~~~~~~~~~~~~~

    destroy: true,
    ~~~~~~~~~~~~~

    PLEASE, please (yes, I’m getting desperate) answer this: *****Which solution is best to use, and in which plugin file do I make this edit to fix the problem and eliminate the error?****
    Thanks for your help!!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi,

    thanks for your post, and sorry for the trouble.

    This indicates that your theme is loading some stuff twice.
    Please check the theme’s “footer.php” file. Either code like

    <?php wp_footer(); ?>
    </body>
    </html>

    will be in there twice or that file is loaded twice by another file.

    Regards,
    Tobias

    Thread Starter joellebb

    (@joellebb)

    Thanks for the quick response. If I’m looking at the correct file, here’s what shows in the “custom-footer.php” file:

    </div><!– end #inner –>

    <?php genesis_before_footer(); ?>

    <div class=”wrap”>
    <div class=”gototop”>
    <center><p> ©1975-2016 · Redwood Writers</p></center>
    </div>
    <div class=”creds”>

    <center><p>Page design & original graphics by Joelle Burnette · Banner photos by Brian Michelsen · Banner design by Christine Walker</p></center>

    </div>

    <center><p>Affordable-custom websites that work!</p></center>

    </div><!– end .wrap –>

    <?php genesis_after_footer(); ?>

    </div><!– end #wrap –>

    <?php wp_footer(); // we need this for plugins ?>
    <?php genesis_after(); ?>

    </body>
    </html>

    ~~~~~~~~~~~~~

    Which line would be the best to remove and not mess up the site?
    Thanks!!

    Hi,

    please try changing the line
    <?php genesis_after(); ?>
    to
    <?php //genesis_after(); ?>
    as a first try.

    Regards,
    Tobias

    Thread Starter joellebb

    (@joellebb)

    Tried it in both spots on their own, and then in both spots simultaneously. Didn’t change anything in the refreshed test pg.

    • This reply was modified 8 years, 3 months ago by joellebb.

    Hi,

    hhm, then the second set of these HTML tags in the footer is coming from somewhere else. Unfortunately, this is something that you’ll have to ask the theme support team then :-/

    Regards,
    Tobias

    Thread Starter joellebb

    (@joellebb)

    Hi Tobias,
    Thanks for trying to figure this out. I appreciate your help.
    Happy Holidays!
    Joelle

    Hi,

    no problem, you are very welcome!

    Best wishes,
    Tobias

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘TablePress reinitialise error: Which plugin file do I need to alter?’ is closed to new replies.