Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="section section-post-related">
- <div class="section_wrapper clearfix">
- <?php
- $thispostid = get_the_ID();
- if( mfn_opts_get( 'blog-related' ) ){
- $tags = wp_get_post_tags($thispostid);
- if ($tags) {
- $tag_ids = array();
- foreach($tags as $individual_tag):
- $tag_ids[] = $individual_tag->term_id;
- endforeach;
- $args=array(
- 'tag__in' => $tag_ids,
- 'post__not_in' => array($post->ID),
- 'posts_per_page'=>3,
- 'caller_get_posts'=>1,
- );
- } else if( $aCategories = wp_get_post_categories( $thispostid )) {
- $args = array(
- 'category__in' => $aCategories,
- 'ignore_sticky_posts' => true,
- 'no_found_rows' => true,
- 'post__not_in' => array( get_the_ID() ),
- 'posts_per_page' => 3,
- 'post_status' => 'publish',
- );
- }
- $query_related_posts = new WP_Query( $args );
- if( $query_related_posts->have_posts() ){
- echo '<div class="section-related-adjustment">';
- echo '<h4>'. $translate['related'] .'</h4>';
- while ( $query_related_posts->have_posts() ){
- $query_related_posts->the_post();
- $classes_rel = '';
- if( ! mfn_post_thumbnail( get_the_ID() ) ) $classes_rel .= 'no-img';
- echo '<div class="column one-third post-related '. implode( ' ', get_post_class( $classes_rel ) ).'">';
- if( get_post_format() == 'quote'){
- echo '<blockquote>';
- echo '<a href="'. get_permalink() .'">';
- the_title();
- echo '</a>';
- echo '</blockquote>';
- } else {
- echo '<div class="image_frame scale-with-grid">';
- echo '<div class="image_wrapper">';
- echo mfn_post_thumbnail( get_the_ID() );
- echo '</div>';
- echo '</div>';
- }
- echo '<div class="date_label">'. get_the_date() .'</div>';
- echo '<div class="desc">';
- if( get_post_format() != 'quote') echo '<h4><a href="'. get_permalink() .'">'. get_the_title() .'</a></h4>';
- echo '</div>';
- echo '</div>';
- }
- echo '</div>';
- }
- wp_reset_postdata();
- }
- ?>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment