Okay
  Public Ticket #1085098
Change the "default number of entries to 5
Closed

Comments

  •  2
    Kim started the conversation

    Dear Support,

    Do you have a simple way to change the "Display length" default value to 5 entries under "Additional settings"?

    Normally the lowest value is 10 entries

    Thanks,

    -Kim


  •  1,771
    Miloš replied

    Hi Kim,
    Thank you for your purchase.

    Unfortunately this functionality is not available without some customization.
    We can offer you our paid customization service to hire one of our developers to implement this feature for you. This kind of customization requires 1 hour of work and our price is 50$/hour.
    If you are interested let me know so we can start the implementation.
    Thank you.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  •  11
    Issac replied

    Hi,

    There is actually two files that need to be slightly edited.

    First file, wpdatatables/templates/edit_table.inc.php, search for id="wpDisplayLength", add the number that you like for the row, let say value of 1, we add this line

     <option value="1" <?php if (isset($table_data['display_length']) && $table_data['display_length'] == '1') { ?>selected="selected"<?php } ?>>1 <?php _e('entries','wpdatatables');?></option>
    

    above the value 10 row. 

    Then go to second file, wpdatatables/source/class.wpdatatable.php, search for the $_lengthDisplay = 10 and change to 1, then search for this line and update the json_decode value to the below:

    $obj->dataTableParams->aLengthMenu = json_decode('[[1,10,25,50,100,-1],[1,10,25,50,100,"All"]]');

    Hopes this will help, at least that is what works for me.