• Resolved norequests

    (@norequests)


    Hello, I’d like to change the default number of rows of a table to a random number without choosing an option from the given ones. So there is 1, 5,10,25, 50 and 100 rows as options, but I want to show 26 or maybe 30 at once. Can you tell me please which file and which line to edit to achieve this? Thanks very much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter norequests

    (@norequests)

    I promise I’ll be careful. Also, I have a staging environment.

    Plugin Author wpDataTables

    (@wpdatatables)

    Hi there.

    Thanks for reaching out to us.

    There are, actually, a couple of files you’d need to change.

    You’ll need to look in here:

    ../wp-content/plugins/wpdatatables/templates/admin/table-settings/table_settings_block.inc.php

    Here, you’ll be looking for <select class="form-control selectpicker" id="wdt-rows-per-page">

    And here:

    ../wp-content/plugins/wpdatatables/source/class.wpdatatable.php

    Where you should look for $obj->dataTableParams->aLengthMenu and public function setDisplayLength($length).

    You would need to add all options you want to include in the plugin. So, there’s no way to make it random, they do need to be added (or existing values modified).

    Kind regards.

    Thread Starter norequests

    (@norequests)

    It worked like a charm, thanks!

    Plugin Author wpDataTables

    (@wpdatatables)

    You’re welcome!

    Glad we could help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Default number of rows’ is closed to new replies.