%1$s ', $overlay_icon ); } if (has_post_thumbnail()) { return sprintf( '
%4$s %3$s
', esc_url(get_the_permalink()), esc_url(get_the_post_thumbnail_url()), $alt, $overlay ); } else { if ($render_empty_figure === true) { return '
'; } } } public static function get_post_title($tag) { return sprintf( ' <%1$s class="dtq-post-title"> %3$s ', $tag, esc_url(get_the_permalink()), get_the_title() ); } // public static function get_post_categories() { // return '
' . et_builder_get_the_term_list( ', ' ) . '
'; // } public static function get_post_categories($show_first_category, $include_categories, $class_name) { if ('off' === $show_first_category) { return sprintf( '
%1$s
', et_builder_get_the_term_list(', '), $class_name ); } else { $pattern = '/,?current/'; $include_categories = preg_replace($pattern, '', $include_categories); $pattern = '/^,?/'; $include_categories = preg_replace($pattern, '', $include_categories); if (!empty($include_categories)) { $categories_ids = explode(',', $include_categories); } else { $categories_ids = get_terms( array('category'), array('fields' => 'ids') ); } return sprintf( '
', get_the_category_by_ID($categories_ids[0]), get_category_link($categories_ids[0]), $class_name ); } } public static function get_post_button( $button_text = 'Read More', $icon_name = '5', $classes = '' ) { return sprintf( '
%3$s
', esc_url(get_the_permalink()), $icon_name, $button_text, $classes ); } public static function get_post_excerpt($length = '150') { $post_id = get_the_ID(); return dtq_strimwidth(get_the_excerpt($post_id), 0, $length, '...'); } public static function get_post_excerpt_html($length = '150') { return sprintf('
%1$s
', self::get_post_excerpt($length)); } }