add table row by javascript onclick

  <input type=“text” name=“” id=“id”> <input type=“text” name=“” id=“name”> <input type=“text” name=“” id=“phone”> <button type=“button” onclick=“add_row()“> ADD ROW </button> <table id=“ThisTable” border=“1”> <tr> <th>Id</th> <th>name</th> <th>phone</th> </tr> <tr> <td>Data1</td> <td>Data1</td> <td>Data1</td> </tr> <tr> <td>Data2</td> <td>Data2</td> <td>Data2</td> </tr> </table> <script> function add_row() { var id = document.getElementById(“id”).value; var name= document.getElementById(“name”).value; var phone = document.getElementById(“phone”).value; // console.log(id …

add table row by javascript onclick Read More »

loop

  for (let i = 0; i < 3; i++) { var data = ‘<div class=”row”>’; for (let j = 1; j < 5; j++) { data += ‘<div class=”col-sm-‘ + j + ‘”>’; data += `<div class=”card” style=”width: 18rem;”> <img src=”…” class=”card-img-top” alt=”…”> <div class=”card-body”> <h5 class=”card-title”>Card title</h5> <p class=”card-text”>Some quick example text to …

loop Read More »

wordpress use nonce in form

 Use the following code inside just before tag on your front end code. wp_nonce_field(‘name_of_your_action’, ‘name_of_your_nonce_field’); The above code will generate two hidden inputs inside your form tag. Now you can verify your nonce in the backend where you will process your form. Use the following code to verify the nonce you just created above. if(wp_verify_nonce($_REQUEST[‘name_of_your_nonce_field’], …

wordpress use nonce in form Read More »

wordpress wp list table pagination

  first page page_no = 1 previous page <?php if ($page_no >=2) {echo $page_no–1;}else{echo ‘1’;}?> //current page <?php echo $page_no; ?> // the next page <?php if ($page_no >=1 && $page_no <$total_pages) { echo $page_no+1; } else { echo $page_no; } ?> //last page <?php echo $total_pages; ?>

wp list table 2

 <div id=“wpbody” role=“main”> <div id=“wpbody-content”> <div class=“wrap”> <h1 class=“wp-heading-inline”> Table Title</h1> <a href=“#” class=“page-title-action”>Add Subscriber</a> <hr class=“wp-header-end”> <h2 class=“screen-reader-text”>Filter posts list</h2> <ul class=“subsubsub”> <li class=“all”><a href=“edit.php?post_type=post” class=“current” aria-current=“page”>Total Subscriber <span class=“count”>(46)</span></a></li> <!– <li class=”publish”><a href=”edit.php?post_status=publish&amp;post_type=post”>Published <span class=”count”>(42)</span></a> |</li> –> </ul> <form id=“posts-filter” method=“get”> <p class=“search-box”> <label class=“screen-reader-text” for=“post-search-input”>Search Posts:</label> <input type=“search” id=“post-search-input” name=“s” value=“”> <input …

wp list table 2 Read More »