Advertisement
fauzanjeg

Example Code in Block_1_View.php

Jan 24th, 2021 (edited)
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.13 KB | None | 0 0
  1. public function render_block_type_1( $post, $image_size ) {
  2.     $thumbnail        = $this->get_thumbnail( $post->ID, $image_size );
  3.     $primary_category = $this->get_primary_category( $post->ID );
  4.     $tags = get_the_tags( $post->ID ); // get the tag
  5.     $tag = implode( ' ', apply_filters( 'limit_tag', $tags ) ); // filter tag and array to string
  6.     $output =
  7.         "<div class=\"jeg_thumb\">
  8.             " . jnews_edit_post( $post->ID ) . "
  9.             <a href=\"" . get_the_permalink( $post ) . "\">" . $thumbnail . "</a>
  10.             <div class=\"jeg_post_category\">
  11.                 <span>{$primary_category}</span>
  12.             </div>
  13.         </div>
  14.         <div class=\"jeg_postblock_content\">
  15.             <h3 property=\"headline\" class=\"jeg_post_title\">
  16.                 <a href=\"" . get_the_permalink( $post ) . "\">" . get_the_title( $post ) . "</a>
  17.             </h3>
  18.             " . $this->post_meta_1( $post ) . "
  19.             <div class=\"jeg_post_excerpt\">
  20.                 <p>" . $this->get_excerpt( $post ) . "</p>
  21.                 <p>" . $tag /* display the tag */ . "</p>
  22.                 <a href=\"" . get_the_permalink( $post ) . "\" class=\"jeg_readmore\">" . jnews_return_translation( 'Read more', 'jnews', 'read_more' ) . "</a>
  23.             </div>
  24.         </div>";
  25.  
  26.     return $output;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement