-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.php
126 lines (91 loc) · 4.35 KB
/
home.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
117
118
119
120
121
122
123
124
125
126
<?php
/**
* The home template file
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package portfolioo
*/
get_header(); ?>
<section class="blog_page">
<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' , 'portfolioo'); ?>
<footer class="entry-footer">
<?php edit_post_link( esc_html__( 'Edit', 'portfolioo' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-footer -->
</header><!-- .entry-header -->
<div class="blog_wrap">
<div class="blg_page_post_list">
<?php
$args = array (
'post__in' => '',
'ignore_sticky_posts' => 'false',
'paged' => $paged
);
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
// the query
$the_query = new WP_Query( $args ); ?>
<?php if ( $the_query->have_posts() ) : ?>
<!-- the loop -->
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<section class="blog_post_list_wrap">
<div class="blog_post_list_img">
<?php if ( has_post_thumbnail() ) {
?> <a href="<?php the_permalink(); ?>"> <?php the_post_thumbnail(); ?> </a> <?php
} ?>
</div>
<div class="blog_post_list_other">
<div class="blog_meta">
<?php
$post_tags = get_the_tags();
if ( $post_tags ) {
echo "<p>". $post_tags[0]->name ."</p>";
} else {
echo '<p>' . esc_html__('Post Tag', 'portfolioo') . '</p>';
}
?>
<?php
$post_date = get_the_date( 'd m, Y' );
echo "<p>". $post_date . "</p>";
?>
</div>
<div class="blog_post_list_others">
<h3 class="blog_post_list_title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<?php get_template_part( 'template-parts/postmeta'); ?>
</div>
</div>
<!-- </div> -->
<div class="clearfix"></div>
</section>
<?php endwhile; ?>
<!-- end of the loop -->
<!-- pagination here -->
<div class="clearfix"></div>
<?php wp_reset_postdata(); ?>
<?php else : ?>
<p><?php esc_html_e( 'Sorry, no posts matched your criteria.', 'portfolioo' ); ?></p>
<?php endif; ?>
<div class="blog_pagination"><div class="clearfix"></div>
<?php next_posts_link(__('Older Entries <i class="fa fa-angle-right" aria-hidden="true"></i> ', 'portfolioo'), $the_query->max_num_pages) ?>
<?php previous_posts_link(__('<i class="fa fa-angle-left" aria-hidden="true"></i> Newer Entries ', 'portfolioo')) ?>
</div> <div class="clearfix"></div><div class="clearfix"></div>
</div>
<div class="sidebar-widget" itemscope="itemscope" itemtype="http://schema.org/WPSideBar">
<?php
if ( ! dynamic_sidebar( 'sidebar-1' ) ) {
the_widget( 'WP_Widget_Meta' );
} ?>
</div>
</div>
</section>
<div class="clearfix"></div>
<section class="footer-widget">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('footer-1') ) : endif; ?>
<div class="clearfix"></div>
</section>
<?php get_footer(); ?>