<h3 class="entry-title" data-itemprop="name"> <a href="<?php the_permalink(); ?> " title="<?php echo esc_attr(get_the_title()); ?> "> <?php the_title(); ?> </a> </h3> <div class="entry-meta icon-meta"> <?php dh_post_meta($show_date, $show_comment, $show_category, $show_author, true, false, null, true); ?> </div> </div> <div class="entry-content"> <?php if ($show_excerpt == 'true') { $excerpt = $post->post_excerpt; if (empty($excerpt)) { $excerpt = $post->post_content; } $excerpt = strip_shortcodes($excerpt); $excerpt = wp_trim_words($excerpt, $excerpt_length, '...'); echo '<p>' . $excerpt . '</p>'; }
<?php $excerpt = $post->post_excerpt; if (empty($excerpt)) { $excerpt = $post->post_content; } $excerpt = strip_shortcodes($excerpt); $excerpt = wp_trim_words($excerpt, $excerpt_length, '...'); echo '<p>' . $excerpt . '</p>'; ?> </div> <?php } ?> <div class="entry-meta bottom-meta"> <?php dh_post_meta(false, $show_comment, $show_category, $show_author, true, ', '); ?> </div> <?php if (empty($hide_readmore)) { ?> <div class="readmore-link"> <a href="<?php the_permalink(); ?> "><?php _e("Read More", DH_THEME_DOMAIN); ?> </a> </div> <?php
function dh_related_post() { global $post; $categories = get_the_category($post->ID); if (!$categories) { return; } $args = array('posts_per_page' => 3, 'post__not_in' => array($post->ID), 'orderby' => 'rand', 'meta_key' => "_thumbnail_id", 'category__in' => wp_get_post_categories($post->ID)); $related = new WP_Query($args); if ($related->have_posts()) { ?> <div class="related-post"> <div class="related-post-title"> <h3><span><?php echo __("You may also like", DH_DOMAIN); ?> </span></h3> </div> <div class="row related-post-items"> <?php while ($related->have_posts()) { $related->the_post(); global $post; ?> <div class="related-post-item col-md-4 col-sm-6"> <?php dh_post_featured('', '', false, true); ?> <div class="entry-meta top-meta"> <?php dh_post_meta(true, false, false, false, true, ', '); ?> </div> <h4 class="post-title" data-itemprop="name"><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h4> <div class="excerpt"> <?php $excerpt = $post->post_excerpt; if (empty($excerpt)) { $excerpt = $post->post_content; } $excerpt = strip_shortcodes($excerpt); $excerpt = wp_trim_words($excerpt, 15, '...'); echo '<p>' . $excerpt . '</p>'; ?> </div> <div class="entry-meta bottom-meta"> <?php dh_post_meta(false, true, false, true, true, ', '); ?> </div> <div class="readmore-link"> <a href="<?php the_permalink(); ?> "><?php _e("Read More", DH_THEME_DOMAIN); ?> </a> </div> </div> <?php } ?> </div> </div> <?php } wp_reset_postdata(); }
$cat_r->the_post(); global $post; if (!$highlighted) { $highlighted = true; $output .= '<article itemtype="' . dh_get_protocol() . '://schema.org/Article" itemscope="" class="latestnews-leading">'; $output .= '<div class="latestnews-thumb">'; $output .= '<a href="' . esc_url(get_the_permalink()) . '" title="' . esc_attr(get_the_title()) . '">'; $output .= get_the_post_thumbnail(null, 'dh-thumbnail', array('data-itemprop' => 'image', 'title' => esc_attr(get_the_title()))); $output .= '</a>'; $output .= '</div>'; $output .= '<h2 data-itemprop="name">'; $output .= '<a data-itemprop="url" title="' . esc_attr(get_the_title()) . '" href="' . esc_url(get_the_permalink()) . '">' . get_the_title() . '</a>'; $output .= '</h2>'; if ($show_comment || $show_date) { $output .= '<div class="entry-meta">'; $output .= dh_post_meta($show_date, $show_comment, false, false, false, '|', 'M j,Y'); $output .= '</div>'; } if (empty($hide_excerpt)) { $output .= '<div class="excerpt">'; $excerpt = $post->post_excerpt; if (empty($excerpt)) { $excerpt = $post->post_content; } $excerpt = strip_shortcodes($excerpt); $excerpt = wp_trim_words($excerpt, $excerpt_length, '...'); $output .= '<p>' . $excerpt . '</p>'; $output .= '</div>'; } $output .= '<meta content="UserComments:' . get_comments_number() . '" itemprop="interactionCount">'; $output .= '<meta content="' . get_the_author() . '" itemprop="author">';
?> ://schema.org/Article" itemscope=""> <div class="hentry-wrap"> <?php if (dh_get_theme_option('blog-heading', 0) != '1' || in_array(get_post_format(), array('audio', 'video', 'gallery'))) { dh_post_featured(); } ?> <div class="entry-header"> <h1 class="entry-title" data-itemprop="name"><?php the_title(); ?> </h1> <div class="entry-meta icon-meta"> <?php dh_post_meta($blog_show_date, $blog_show_comment, $blog_show_category, $blog_show_author, true, '|', null, false); ?> </div> </div> <div class="entry-content" data-itemprop="mainContentOfPage"> <?php the_content(esc_html__('Continue reading…', 'jakiro')); ?> <?php wp_link_pages(array('before' => '<div class="page-links">' . esc_html__('Pages:', 'jakiro'), 'after' => '</div>')); ?> </div> <div class="entry-footer"> <?php if ($blog_show_tag && has_tag()) { ?>