Advertisement
GochiSiyan

custom code

Aug 31st, 2021
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. <?php
  2. /**
  3. * @author : Jegtheme
  4. */
  5. namespace JNews\Module\Hero;
  6.  
  7. Class Hero_13_View extends HeroViewAbstract
  8. {
  9. public function get_module_name()
  10. {
  11. return esc_html__('JNews - Hero 13', 'jnews');
  12. }
  13.  
  14. public function render_block_type_1($post)
  15. {
  16. if($post) {
  17. $post_id = $post->ID;
  18. $permalink = get_the_permalink($post);
  19. $subtitle = wp_kses( get_post_meta( $post->ID, 'post_subtitle', true ), wp_kses_allowed_html() );
  20.  
  21. return "<article " . jnews_post_class("jeg_post jeg_hero_item_1", $post_id) . " style=\"padding: 0 0 {$this->margin}px {$this->margin}px;\">
  22. <div class=\"jeg_block_container\">
  23. " . jnews_edit_post($post_id) . "
  24. <span class=\"jeg_postformat_icon\"></span>
  25. <div class=\"jeg_thumb\">
  26. <a href=\"{$permalink}\" >{$this->get_thumbnail($post_id, 'jnews-featured-1140')}</a>
  27. </div>
  28. <div class=\"jeg_postblock_content\">
  29. <div class=\"jeg_post_category\">{$this->get_primary_category($post_id)}</div>
  30. <div class=\"jeg_post_info\">
  31. <h2 class=\"jeg_post_title\">
  32. <a href=\"{$permalink}\" >" . get_the_title($post) . "</a>
  33. </h2>
  34. <h3 class=\"jeg_post_subtitle\">
  35. " . $subtitle . "
  36. </h3>
  37. " . '<div class="jeg_post_excerpt">
  38. <p>' . $this->get_excerpt( $post ) . '</p>
  39. </div>' . "
  40. {$this->post_meta_3($post)}
  41. </div>
  42. </div>
  43. </div>
  44. </article>";
  45. }
  46. return null;
  47. }
  48.  
  49. public function render_element($result)
  50. {
  51. return $this->render_block_type_1($result[0]);
  52. }
  53. }
  54.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement