-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcategory.php
52 lines (50 loc) · 1.86 KB
/
category.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php get_header(); ?>
<!-- WP_Query -->
<?php
$args = array(
'post_type' => 'post',
'cat' => 'inheret'
);
$cat_posts = new WP_Query( $args );
?>
<!-- Main Content + sidbar area -->
<div id="category">
<!-- Main Content -->
<div>
<div class="heading-box">
<h1 class="hp-heading hp-heading_hp" data-aos="fade-in"><?php single_cat_title(); ?><span class="line" data-aos="fade-right" data-aos-duration="1000"></span></h1>
</div>
<div class="cat-content clearfix">
<?php
$do_not_duplicate = array();
if ( have_posts() ) : while ( have_posts() ) : the_post();
$do_not_duplicate[] = $post->ID;
?>
<div class="card one-third">
<a href="<?php the_permalink() ?>" class="item-container">
<div class="card-img">
<?php
if ( in_category( '5' ) ){ the_post_thumbnail('large'); }
else { the_post_thumbnail('thumbnail'); }
?>
</div>
<div class="card-desc">
<!-- <div class="post-category">
<?php //the_category(' '); ?>
</div> -->
<h2 class="title"><?php the_title(); ?></h2>
<p>
By <?php the_author(); ?>
<?php //echo get_the_date(); ?>
</p>
<p>
<?php echo wp_trim_words( get_the_content(), 50, '...' ); ?>
</p>
</div>
</a>
</div>
<?php endwhile; endif; wp_reset_postdata(); ?>
</div>
</div>
</div>
<?php get_footer(); ?>