How to customize admin dashboard in wordpress

0

 How to customize admin dashboard in wordpress:-


If you want to show any dynamic content under wordpress dashboard page without using page template, then we can customize wp-admin/index.php file and display database content here.


Now i am providing complete code to fetch data from database and display in dashboard page.

<?php
/**
 * Dashboard Administration Screen
 *
 * @package WordPress
 * @subpackage Administration
 */

/** Load WordPress Bootstrap */
require_once __DIR__ . '/admin.php';

/** Load WordPress dashboard API */
require_once ABSPATH . 'wp-admin/includes/dashboard.php';











require_once ABSPATH . 'wp-admin/admin-header.php';
?>

<div class="wrap">
   
   <h1>Welcome in SCS</h1>
   
   <div style="margin-left: 40px;margin-top: 50px;float:left;">
   <p>View Student Record Here</p>
   <table border="1">
      <tr><th>RNO</th><th>Sname</th><th>Branch</th><th>fees</th></tr>
  <?php

  $res = $wpdb->get_results( "SELECT rno,sname,branch,fees FROM wp_students");

   foreach ($res as $x) {
      echo "<tr><td>".$x->rno,"</td><td>".$x->sname."</td><td>".$x->branch."</td><td>".$x->fees."</td></tr>";
   }
   
  ?>
</table>
</div>
</section>


   <div id="dashboard-widgets-wrap">
   
   </div><!-- dashboard-widgets-wrap -->

</div><!-- wrap -->

<?php
wp_print_community_events_templates();

require_once ABSPATH . 'wp-admin/admin-footer.php';






Tags

Post a Comment

0Comments

POST Answer of Questions and ASK to Doubt

Post a Comment (0)