1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Auto Load Next Post Theme Support: Understrap |
4
|
|
|
* |
5
|
|
|
* Applies support for Understrap Theme. |
6
|
|
|
* |
7
|
|
|
* @since 1.5.0 |
8
|
|
|
* @version 1.6.0 |
9
|
|
|
* @author Sébastien Dumont |
10
|
|
|
* @category Theme Support |
11
|
|
|
* @package Auto Load Next Post/Theme Support |
12
|
|
|
* @license GPL-2.0+ |
13
|
|
|
*/ |
14
|
|
|
|
15
|
|
|
// Exit if accessed directly. |
16
|
|
|
if ( ! defined( 'ABSPATH' ) ) { |
17
|
|
|
exit; |
18
|
|
|
} |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* ALNP_Understrap class. |
22
|
|
|
*/ |
23
|
|
|
class ALNP_Understrap { |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* Initlize Theme. |
27
|
|
|
* |
28
|
|
|
* @access public |
29
|
|
|
* @static |
30
|
|
|
*/ |
31
|
|
|
public static function init() { |
32
|
|
|
// Add theme support and preset the theme selectors. |
33
|
|
|
add_action( 'after_setup_theme', array( __CLASS__, 'add_theme_support' ) ); |
34
|
|
|
|
35
|
|
|
// Filters the repeater template location. |
36
|
|
|
//add_filter( 'alnp_template_location', array( __CLASS__, 'alnp_understrap_template_location' ) ); |
37
|
|
|
} // END init() |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* Filters the template location for get_template_part(). |
41
|
|
|
* |
42
|
|
|
* @access public |
43
|
|
|
* @static |
44
|
|
|
*/ |
45
|
|
|
public static function alnp_understrap_template_location() { |
46
|
|
|
return 'loop-templates/'; |
47
|
|
|
} // alnp_understrap_template_location() |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* Add theme support by providing the theme selectors |
51
|
|
|
* to be applied once the theme is activated. |
52
|
|
|
* |
53
|
|
|
* @access public |
54
|
|
|
* @static |
55
|
|
|
*/ |
56
|
|
|
public static function add_theme_support() { |
57
|
|
|
add_theme_support( 'auto-load-next-post', array( |
58
|
|
|
'content_container' => 'main.site-main', |
59
|
|
|
'title_selector' => 'h1.entry-title', |
60
|
|
|
'navigation_container' => 'nav.post-navigation', |
61
|
|
|
'comments_container' => 'div#comments', |
62
|
|
|
'load_js_in_footer' => 'no', |
63
|
|
|
'lock_js_in_footer' => 'no', |
64
|
|
|
'directory_post' => 'loop-templates/' |
65
|
|
|
) ); |
66
|
|
|
} // END add_theme_support() |
67
|
|
|
|
68
|
|
|
} // END class |
69
|
|
|
|
70
|
|
|
ALNP_Understrap::init(); |
71
|
|
|
|