-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent-alnp.php
75 lines (58 loc) · 2.36 KB
/
content-alnp.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
<?php
/**
* The repeater template for displaying a post when called.
*
* @author Sébastien Dumont
* @license GPL-2.0+
* @version 1.5.0
*/
if ( have_posts() ) :
// Load content before the loop.
do_action( 'alnp_load_before_loop' );
// Check that there are posts to load.
while ( have_posts() ) : the_post();
$post_format = get_post_format(); // Post Format e.g. video
$post_type = alnp_get_post_type(); // Post Type e.g. single
// Load content before the post content.
do_action( 'alnp_load_before_content' );
// Load content before the post content for a specific post format.
do_action( 'alnp_load_before_content_post_format_' . $post_format );
// Load content before the post content for a specific post type.
do_action( 'alnp_load_before_content_post_type_' . $post_type );
if ( false === $post_format ) {
/*
* Include the Post-Type-specific template for the content.
* content-___.php (where ___ is the Post Type name).
*/
if ( locate_template( alnp_template_location() . 'content-' . $post_type . '.php') != '' ) {
get_template_part( alnp_template_location() . 'content', $post_type );
} else {
// If no specific post type found then fallback to standard content.php file.
get_template_part( alnp_template_location() . 'content' );
}
} else {
/*
* Include the Post-Format-specific template for the content.
* called format-___.php (where ___ is the Post Format name).
*/
if ( locate_template( alnp_template_location() . 'format-' . $post_format . '.php' ) != '' ) {
get_template_part( alnp_template_location() . 'format', $post_format );
} else {
// If no format-{post-format}.php file found then fallback to content-{post-format}.php
get_template_part( alnp_template_location() . 'content', $post_format );
}
}
// Load content after the post content for a specific post type.
do_action( 'alnp_load_after_content_post_type_' . $post_type );
// Load content after the post content for a specific post format.
do_action( 'alnp_load_after_content_post_format_' . $post_format );
// Load content after the post content.
do_action( 'alnp_load_after_content' );
// End the loop.
endwhile;
// Load content after the loop.
do_action( 'alnp_load_after_loop' );
else :
// Load content if there are no more posts.
do_action( 'alnp_no_more_posts' );
endif; // END if have_posts()