This repository was archived by the owner on Nov 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloop-single.php
More file actions
executable file
·95 lines (74 loc) · 3.3 KB
/
loop-single.php
File metadata and controls
executable file
·95 lines (74 loc) · 3.3 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
global $hipoul_settings;
$post_type = get_post_type_object( get_post_type() );
/**
* Check if the post has a post format. Load a post-format specific loop file,
* if it has. Continue with standard loop otherwise.
*/
if ( function_exists( 'get_post_format' ) ) {
global $post_format;
$post_format = get_post_format();
// Get the post formats supported by the theme
$supported_formats = get_theme_support( 'post-formats' );
if(is_array($supported_formats)) $supported_formats = $supported_formats[0];
if(in_array($post_format, $supported_formats)){
// Get the post format loop file
get_template_part( 'loop-post-formats', $post_format );
// Stop this default posts loop
return;
}
}
?>
<?php /* Post navigation */ ?>
<?php hipoul_post_nav(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class( 'post' ); ?>>
<?php do_action( 'hipoul_before_post' ); ?>
<div class="entry">
<h1 class="post-title entry-title">
<?php if ( get_the_title() == '' ) { _e( '(No title)', 'hipoul' ); } else { the_title(); } ?>
<?php do_action( 'hipoul_post_title' ); ?>
</h1>
<div class="post-meta">
<?php
/* Edit post link, if user is logged in */ ?>
<?php if ( is_user_logged_in() ) : ?>
<span class="edit-post">
<?php edit_post_link( sprintf( __( 'Edit', 'hipoul' ), $post_type->labels->singular_name ), ' ', '' ); ?>
</span>
<?php endif;
/* Post author, not shown if this is a Page post or if admin decides to hide it */
if ( $post_type->name != 'page' && $hipoul_settings['hide_post_author'] != true ) : ?>
<span class="post-author author vcard">
<?php
/* Show the post author's gravatar */
echo '<div class="post-avatar-wrap">' . get_avatar( get_the_author_meta( 'user_email' ), 45 ) . '</div>';
$author_url = '<a href="' . get_author_posts_url( get_the_author_meta( 'ID' ) ) . '" class="url" rel="author">' . get_the_author_meta( 'display_name' ) . '</a>';
printf( '<span class="fn nickname">' . $author_url . '</span>' );
?>
</span>
<?php endif;
/* Post date is not shown if this is a Page post */
if (hipoul_should_show_date())
hipoul_post_date(get_permalink());
/* Display comments number */
if (hipoul_should_show_comments()): ?>
<span class="comments-span">
<i class="fa fa-lg fa-comments"></i>
<a href="<?php echo the_permalink() ?>#comments"><?php echo get_comments_number(); ?> Comments</a>
</span>
<?php endif;
do_action( 'hipoul_post_meta' ); ?>
</div>
<?php /* Post content */ ?>
<div class="entry-content">
<?php do_action( 'hipoul_before_post_content' ); ?>
<?php /* The full content */ ?>
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<div class="link-pages"><p><strong>' . __( 'Pages:','hipoul' ) . '</strong> ', 'after' => '</p></div>', 'next_or_number' => 'number' ) ); ?>
<?php do_action( 'hipoul_after_post_content' ); ?>
</div>
</div>
</div>
<?php /* Get the comments template for single post pages */ ?>
<?php comments_template(); ?>
<?php do_action( 'hipoul_loop_footer' ); ?>