I want a pagination to my options page of wordpress plugin?

后端 未结 3 1375
轮回少年
轮回少年 2020-12-06 04:38

MY DEMO

I want a pagination according to the results coming from wordpress database...This is all done on my options page of wordpress plugin..

My code to re

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-06 05:18

    get_var( 'SELECT COUNT(`id`) FROM `wp_dive`' );
    $num_of_pages = ceil( $total / $limit );
    $result = $wpdb->get_results( "SELECT `id`,`name_cust`,`gender_cust`,`dob_cust` FROM `wp_dive` LIMIT $offset, $limit" );
    
    $data_html = '';
    
    foreach( $result as $results ) 
    
        {
        $id=$results->id;
        $name= $results->name_cust;
        $gender= $results->gender_cust;
        $dob= $results->dob_cust;
    ?>
    ";?>
    ". $id."";?>
    ". $name."";?>
    ".$gender."";?>
    ".  $dob ."";?>
    "?>
     add_query_arg( 'paged', '%#%' ),
        'format' => '',
        'prev_text' => '«',
        'next_text' => '»',
        'total' => $total,
        'current' => $paged
    ) );
    
    if ( $page_links ) {
        echo '
    ' . $page_links . '
    '; } ?>

提交回复
热议问题