did some sniff sniff
This commit is contained in:
@@ -6,34 +6,34 @@
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
$post_class = has_post_thumbnail() ? "has-thumbnail wow fadeInUp" : "no-thumbnail wow fadeInUp";
|
||||
$post_class = has_post_thumbnail() ? 'has-thumbnail wow fadeInUp' : 'no-thumbnail wow fadeInUp';
|
||||
?>
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class( $post_class ); ?>>
|
||||
<div class="thumb-cat-wrap">
|
||||
<?php if ( has_post_thumbnail() ) : ?>
|
||||
<a href="<?php echo esc_url( get_permalink() ); ?>" rel="bookmark">
|
||||
<?php sophia_after_dark_post_thumbnail(); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<div class="thumb-cat-wrap">
|
||||
<?php if ( has_post_thumbnail() ) : ?>
|
||||
<a href="<?php echo esc_url( get_permalink() ); ?>" rel="bookmark">
|
||||
<?php sophia_after_dark_post_thumbnail(); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php sophia_after_dark_article_categories_list(); ?>
|
||||
</div>
|
||||
<?php sophia_after_dark_article_categories_list(); ?>
|
||||
</div>
|
||||
|
||||
<?php if ( "post" === get_post_type() ) : ?>
|
||||
<div class="entry-cat">
|
||||
<?php
|
||||
sophia_after_dark_posted_on();
|
||||
sophia_after_dark_posted_by();
|
||||
?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ( 'post' === get_post_type() ) : ?>
|
||||
<div class="entry-cat">
|
||||
<?php
|
||||
sophia_after_dark_posted_on();
|
||||
sophia_after_dark_posted_by();
|
||||
?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<header class="entry-header">
|
||||
<?php the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); ?>
|
||||
</header>
|
||||
<header class="entry-header">
|
||||
<?php the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); ?>
|
||||
</header>
|
||||
|
||||
<footer class="entry-footer">
|
||||
<?php sophia_after_dark_entry_footer(); ?>
|
||||
</footer>
|
||||
<footer class="entry-footer">
|
||||
<?php sophia_after_dark_entry_footer(); ?>
|
||||
</footer>
|
||||
</article>
|
||||
|
||||
@@ -8,34 +8,34 @@
|
||||
global $post;
|
||||
$related_post_id = get_the_ID();
|
||||
$get_categories = get_the_terms( $related_post_id, 'category' );
|
||||
$selected_cat = ! empty( $get_categories ) && is_array( $get_categories ) ? wp_list_pluck( $get_categories, 'term_id' ) : [];
|
||||
$selected_cat = ! empty( $get_categories ) && is_array( $get_categories ) ? wp_list_pluck( $get_categories, 'term_id' ) : array();
|
||||
|
||||
$related_posts_count = apply_filters( 'sophia_after_dark_related_posts_count', 3 );
|
||||
$related_posts_title = apply_filters( 'sophia_after_dark_related_posts_section_title', __( 'Related Posts', 'sophia-after-dark' ) );
|
||||
|
||||
$related_posts_args = [
|
||||
$related_posts_args = array(
|
||||
'posts_per_page' => absint( $related_posts_count ),
|
||||
'post__not_in' => [ $related_post_id ],
|
||||
'post__not_in' => array( $related_post_id ),
|
||||
'category__in' => $selected_cat,
|
||||
];
|
||||
);
|
||||
|
||||
$related_posts_query = new WP_Query( $related_posts_args );
|
||||
|
||||
if ( $related_posts_query->have_posts() ) :
|
||||
?>
|
||||
?>
|
||||
<section class="sad-single-related-posts">
|
||||
<h2 class="sad-related-post-title"><?php echo esc_html( $related_posts_title ); ?></h2>
|
||||
|
||||
<div class="sad-related-posts-wrapper">
|
||||
<?php
|
||||
while ( $related_posts_query->have_posts() ) :
|
||||
$related_posts_query->the_post();
|
||||
get_template_part( 'template-parts/related/content', 'related' );
|
||||
while ( $related_posts_query->have_posts() ) :
|
||||
$related_posts_query->the_post();
|
||||
get_template_part( 'template-parts/related/content', 'related' );
|
||||
endwhile;
|
||||
?>
|
||||
</div>
|
||||
</section>
|
||||
<?php
|
||||
<?php
|
||||
endif;
|
||||
|
||||
wp_reset_postdata();
|
||||
|
||||
Reference in New Issue
Block a user