Guest User

Untitled

a guest
Jan 12th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. <div >
  2. <table>
  3. <tr>
  4.  
  5. <?php foreach($categories as $category) {?>
  6. <td>
  7.  
  8. <?php
  9. $args= array( 'posts_per_page' => 8, 'category_name' => $category-name);
  10. $myposts = get_posts( $args );
  11. ?>
  12. <table border=1>
  13. <thead><?php echo $category->name ?></thead>
  14. <?php
  15. foreach ( $myposts as $post ) : setup_postdata( $post );
  16. if (have_posts()) {
  17. ?>
  18. <tbody>
  19.  
  20. <tr>
  21.  
  22. <td data-points="<?php echo $points ;?>" data-question="<?php echo get_the_content(); ?>"
  23. data-answer="<?php echo get_the_content(); ?>"
  24. >
  25. </td>
  26.  
  27. </tr>
  28.  
  29. </tbody>
  30.  
  31. <br/>
  32. <?php
  33. endforeach;
  34. ?></table><?php
  35. wp_reset_postdata();
  36. ?>
  37.  
  38. <?php }?>
  39. </td></tr>
  40.  
  41. </div>
  42.  
  43. <td data-points="<?php echo $points ;?>" data-question="<?php echo get_the_content(); ?>"
  44. data-answer="<?php echo get_the_content(); ?>"
  45. >
Add Comment
Please, Sign In to add comment