WordPress.org

Ready to get started?Download WordPress

Forums

TablePress
[resolved] Full Number Pagination (4 posts)

  1. boysrus
    Member
    Posted 1 year ago #

    I also found a custom function you provided for table reloaded to add full number pagination rather than the back/forward arrows.

    // Datatables Pagination
    	add_filter( 'wp_table_reloaded_js_frontend_parameters', 'wp_table_reloaded_change_pagination_type' );
    	function wp_table_reloaded_change_pagination_type( $parameters ) {
    	    $parameters['pagination_type'] = '"sPaginationType": "full_numbers"';
    	    return $parameters;
    	}

    I tried adjusting this to work with Tablepress but with no luck. Is this possible with Tablepress as well.

    http://wordpress.org/extend/plugins/tablepress/

  2. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    yes, this is possible in TablePress as well.
    If you want this for all tables, using some code like that is the best way, indeed:

    // DataTables Pagination
    add_filter( 'tablepress_datatables_parameters', 'tablepress_change_pagination_type', 10, 4 );
    function tablepress_change_pagination_type( $parameters, $table_id, $html_id, $js_options ) {
    	$parameters['pagination_type'] = '"sPaginationType": "full_numbers"';
    	return $parameters;
    }

    That could should go into a small new plugin or into your theme's "functions.php".

    If you just want this on a few tables, just enter

    "sPaginationType": "full_numbers"

    into the "Custom Commands" textfield in the "Features of the DataTables JavaScript library" section on the "Edit" screen of these tables.

    Regards,
    Tobias

  3. boysrus
    Member
    Posted 1 year ago #

    Perfect, thanks.

  4. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    sure, no problem! You are very welcome! Great to hear that this worked so easily! :-)

    Best wishes,
    Tobias

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags