This repository was archived by the owner on Dec 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauthor.php
116 lines (101 loc) · 5.59 KB
/
author.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
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
/**
* The template for displaying the author pages
*
* Learn more: https://codex.wordpress.org/Author_Templates
*
* @package UnderStrap
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
get_header();
$container = get_theme_mod( 'understrap_container_type' );
?>
<header id="inner-header">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="header-caption">
<h1><?php the_author(); ?></h1>
</div>
<!-- /.header-caption -->
</div>
<!-- /.col-md-12 -->
</div>
<!-- /.row -->
</div>
<!-- /.container -->
</header>
<div id="blogs">
<div class="blog-items section-area">
<div class="container">
<div class="row">
<div class="col-md-12">
<?php
while(have_posts()): the_post(); ?>
<div class="blog-item">
<div class="row">
<div class="col-md-5">
<div class="blog-photo">
<a href="<?php echo get_permalink(); ?>">
<?php
$values = get_field( 'featured_image_blog' );
if ( $values ) { ?>
<?php
$imageID = get_field('featured_image_blog');
$image = wp_get_attachment_image_src( $imageID, 'blogthumb-image' );
$alt_text = get_post_meta($imageID , '_wp_attachment_image_alt', true);
?>
<img class="img-responsive" alt="<?php echo $alt_text; ?>" src="<?php echo $image[0]; ?>" />
<?php
} else { ?>
<img src="<?php bloginfo('template_directory'); ?>/img/misc/placeholder.jpg" alt="">
<?php } ?>
<i class="fal fa-image"></i>
</a>
</div>
<!-- /.blog-photo-->
</div>
<!-- /.col-md-5 -->
<div class="col-md-7">
<div class="blog-content">
<div class="blog-meta">
<?php $author_id = get_the_author_meta( 'ID' ); ?>
<span><a href="<?php echo get_author_posts_url($author_id); ?>"><?php the_author_meta( 'display_name', $author_id ); ?> </a></span>
<span>
<?php
global $post;
$categories = get_the_category($post->ID);
$cat_link = get_category_link($categories[0]->cat_ID);
echo '<a href="'.$cat_link.'">'.$categories[0]->cat_name.'</a>'
?>
</span>
<span class="date-span"><?php echo get_the_date( 'F j, Y' ); ?></span>
</div>
<!-- /.category -->
<h2><a href="<?php echo get_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php the_field('excerpt_text'); ?>
<a href="<?php echo get_permalink(); ?>" class="read-more">Read More</a>
</div>
<!-- /.blog-content -->
</div>
<!-- /.col-md-7 -->
</div>
<!-- /.row -->
</div>
<?php endwhile; ?>
<nav class="pagination-block">
<?php if( function_exists('wp_pagenavi') ) wp_pagenavi(); // WP-PageNavi function ?>
</nav>
</div>
<!-- /.col-md-12 -->
</div>
<!-- /.row -->
</div>
<!-- /.container -->
</div>
<!-- /.blog-items -->
</div>
<!-- /#blogs -->
<?php
get_footer();