Açıklama Yok

page-events.php 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * The template for displaying all pages
  4. *
  5. * This is the template that displays all pages by default.
  6. * Please note that this is the WordPress construct of pages
  7. * and that other 'pages' on your WordPress site may use a
  8. * different template.
  9. *
  10. * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
  11. *
  12. * @package whitesports
  13. */
  14. get_header();
  15. ?>
  16. <section class="page-title" style="background-image:url(images/background/1.jpg);">
  17. <div class="container">
  18. <div class="title-text">
  19. <h1>Events</h1>
  20. </div>
  21. </div>
  22. </section>
  23. <div class='container'>
  24. <?php
  25. $posts = get_posts(array('category__in'=> [46], 'post_status' => 'publish' ,'numberposts' => -1));
  26. ?>
  27. <?php foreach($posts as $p): ?>
  28. <div class='row border event-con'>
  29. <div class="col-md-3">
  30. <img src="<?= get_the_post_thumbnail_url($p) ?>" style="width:100%">
  31. </div>
  32. <div class="col-md-9">
  33. <h4 class="media-heading"><a href="<?= get_permalink($p) ?>"><?= $p->post_title ?></a></h4>
  34. <i class="far fa-calendar"></i>
  35. <?= get_field('start_date', $p) ?>&nbsp;&nbsp;&nbsp;&nbsp;
  36. <i class="fas fa-map-marker-alt"></i>
  37. <?php $location = get_field('location', $p) ?>
  38. <?php //var_dump($location) ?>
  39. <a href="https://www.google.com/maps/place/?q=place_id:<?= $location['place_id'] ?>" target="_blank">
  40. <?= $location['name'] ?></a>
  41. <br><br>
  42. <p><?= $p->post_excerpt ?></p>
  43. <a href="<?= get_permalink($p) ?>" class='btn-style-two event-btn'>ดูรายละเอียดเพิ่มเติม</a>
  44. <a href="" class='btn-style-one event-btn'>ลงทะเบียนกิจกรรม</a>
  45. </div>
  46. </div>
  47. <?php endforeach ?>
  48. </div>
  49. <?php
  50. get_footer();