Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function render_block_type_2( $post, $image_size ) {
- $post_id = $post->ID;
- $additional_class = ( ! has_post_thumbnail( $post_id ) ) ? ' no_thumbnail' : '';
- $permalink = get_the_permalink( $post );
- $content = '<article ' . jnews_post_class( 'jeg_post jeg_pl_sm' . $additional_class, $post_id ) . '> '. "
- <a href=\"{$permalink}\">".'
- <div>
- <div class="jeg_thumb">
- '. "
- {$this->get_thumbnail($post_id, $image_size)}
- </div>
- <div class=\"jeg_postblock_content\">
- <h3 class=\"jeg_post_title\">
- ". get_the_title( $post ) . "
- </h3>
- {$this->post_meta_2($post)}
- </div>
- </div>
- </a>
- </article>";
- $updatedContent = preg_replace_callback('/<a[^>]*>(.*?)<\/a>/i', function ($matches) {
- $content = $matches[1];
- return '<div>' . $content . '</div>';
- }, $content);
- return $updatedContent ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement