-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcategory.php
More file actions
executable file
·79 lines (66 loc) · 2.81 KB
/
category.php
File metadata and controls
executable file
·79 lines (66 loc) · 2.81 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
/**
* The template for displaying all pages
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package uw_wp_theme
*/
get_header();
$sidebar = get_post_meta( $post->ID, 'sidebar' );
// get the image header.
get_template_part( 'template-parts/header', 'image' );
?>
<div class="container-fluid ">
<?php echo uw_breadcrumbs(); ?>
</div>
<div class="container-fluid uw-body">
<div class="row">
<main id="primary" class="site-main uw-body-copy col-md-<?php echo ( ( ! isset( $sidebar[0] ) || 'on' !== $sidebar[0] ) ? '8' : '12' ); ?>">
<?php
$blog_id = get_current_blog_id();
if($blog_id == 39){
$category = get_queried_object();
$category_id = $category->term_id; ?>
<ul class="shortcode-blogroll cat_wrapper">
<?php while ( have_posts() ) : the_post(); ?>
<li>
<span>
<h2>
<a href="<?php echo get_permalink(); ?>"><?php echo get_the_title(); ?></a>
<p class="date"><?php echo get_the_date(); ?></p>
</h2>
<?php
$thumbnail_id = get_post_thumbnail_id( $post->ID );
$url = wp_get_attachment_url( $thumbnail_id, 'full' );
$alt = get_post_meta($thumbnail_id, '_wp_attachment_image_alt', true);
if($url):?>
<img width="150" height="150" src="<?php echo $url; ?>" class="float-left wp-post-image" alt="<?php echo $alt; ?>" loading="lazy" sizes="100vw"><?php endif; ?><p><?php echo wp_trim_words(get_the_excerpt(), 60); ?></p>
<p><a href="<?php echo get_permalink(); ?>" class="more" aria-label="Read more <?php echo get_the_title(); ?>">Read More</a></p></span>
</li>
<?php
endwhile; // End of the loop. ?>
</ul>
<?php echo "<nav class='navigation pagination'><div class='nav-links'>";
echo paginate_links( array(
'mid_size' => 3,
'prev_text' => __( '« Prev', 'textdomain' ),
'next_text' => __( 'Next »', 'textdomain' ),
) );
echo "</div></nav>";
}else{
while ( have_posts() ) : the_post();
get_template_part( 'template-parts/content', 'page' );
endwhile; // End of the loop.
}
?>
</main><!-- #primary -->
<?php
if ( ! isset( $sidebar[0] ) || 'on' !== $sidebar[0] ) {
get_sidebar();
}
?>
</div><!-- .row -->
</div><!-- .container -->
<?php
get_footer();