Advertisement
GochiSiyan

popup-post.php

Jan 18th, 2022
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. <?php
  2.  
  3. use JNews\Module\ModuleQuery;
  4.  
  5. global $post;
  6. $category = [];
  7. foreach (get_the_category($post->ID) as $term) {
  8. $category[] = $term->term_id;
  9. }
  10.  
  11. $result = ModuleQuery::do_query(
  12. array(
  13. 'post_type' => 'post',
  14. 'sort_by' => 'oldest',
  15. 'post_offset' => 0,
  16. 'include_category' => implode(',', $category),
  17. 'number_post' => isset( $number_popup_post ) ? $number_popup_post : 1,
  18. 'pagination_number_post' => 1,
  19. 'date_query' => array(
  20. 'column' => 'post_date',
  21. 'after' => $post->post_date,
  22. ),
  23. )
  24. );
  25.  
  26. if ( !empty( $result['result'] ) ) : ?>
  27. <section class="jeg_popup_post">
  28. <span class="caption"><?php jnews_print_translation('Next Post', 'jnews', 'next_post'); ?></span>
  29.  
  30. <?php foreach ( $result['result'] as $res ) : ?>
  31. <div class="jeg_popup_content">
  32. <div class="jeg_thumb">
  33. <?php echo jnews_edit_post( $res->ID ); ?>
  34. <a href="<?php echo esc_url( get_permalink( $res->ID ) ); ?>">
  35. <?php echo apply_filters( 'jnews_image_thumbnail', $res->ID, 'jnews-75x75' ); ?>
  36. </a>
  37. </div>
  38. <h3 class="post-title">
  39. <a href="<?php echo esc_url( get_permalink( $res->ID ) ); ?>">
  40. <?php echo wp_kses_post( $res->post_title ); ?>
  41. </a>
  42. </h3>
  43. </div>
  44. <?php endforeach ?>
  45.  
  46. <a href="#" class="jeg_popup_close"><i class="fa fa-close"></i></a>
  47. </section>
  48. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement