Place my DataTable in to a Wordpress Site

Place my DataTable in to a Wordpress Site

AuronGraffAuronGraff Posts: 11Questions: 2Answers: 0

I end my table, and now i need to place it in one page in my wordpress site.

how i make this?

Answers

  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin

    Like you would do with any Javascript library. You'd need to refer to the WordPress documentation for that.

    If you want a plug-in, consider using the TablePress plug-in for WordPress which uses DataTables.

    Allan

  • AuronGraffAuronGraff Posts: 11Questions: 2Answers: 0

    i just throwthe js from datatables, the css and my html file in to wordpress

    I have all my HTML and datatable resources in a folder, with the js css and my .html.

    i need to place it in one page of my site.

    I already try toplace it in the wp-contet/plugins but didnt work, so i dont know where to place it

  • ibdfariaibdfaria Posts: 15Questions: 4Answers: 0
    edited November 2015

    You will need to add all datatables files to the theme folder. Then you need to go to functions.php to properly enqueue those files. You will also need to enqueue your own .js script with the datatables initializer/settings.

    How to enqueue scripts with wordpress:
    https://codex.wordpress.org/Function_Reference/wp_enqueue_script

    How to enqueue styles with wordpress:
    https://codex.wordpress.org/Function_Reference/wp_enqueue_style

    There's also a plugin called TablePress that allows you to use datatables.

  • AuronGraffAuronGraff Posts: 11Questions: 2Answers: 0

    The js, css is into the folder called "DataTable" but i have a folder called "Publica"

    Publica/DataTable/....

    i already move all my files iside the Theme Child Folder.

    Avada-Theme-Child/Publica/DataTable/....

    So now, when i place all my html code inside the page, i only copy paste my code inside the defaullt text.

    And when i see the page i can see all the table but no the style form datatable i selected

  • AuronGraffAuronGraff Posts: 11Questions: 2Answers: 0

    I found this ibdfaria:

    function theme_enqueue_styles() {

    wp_enqueue_style( 'avada-parent-stylesheet', get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'avada-parent-stylesheet', get_template_directory_uri() . '/style.css' );
    

    }

    wo now what i need to place here? :

    wp_enqueue_style( 'avada-parent-stylesheet', get_template_directory_uri() . '/style.css' );
    
  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin

    I should point out that this is not a WordPress forum. If you need help with WordPress, then please refer to the WordPress documentation and support options.

    Allan

This discussion has been closed.