@@ -36,18 +36,18 @@ discard block |
||
36 | 36 | * If theme does not have a template file for Auto Load Next Post, |
37 | 37 | * the plugin will load a default template. |
38 | 38 | */ |
39 | - $child_path = get_stylesheet_directory() . '/' . AUTO_LOAD_NEXT_POST_TEMPLATE_PATH; |
|
40 | - $template_path = get_template_directory() . '/' . AUTO_LOAD_NEXT_POST_TEMPLATE_PATH; |
|
39 | + $child_path = get_stylesheet_directory().'/'.AUTO_LOAD_NEXT_POST_TEMPLATE_PATH; |
|
40 | + $template_path = get_template_directory().'/'.AUTO_LOAD_NEXT_POST_TEMPLATE_PATH; |
|
41 | 41 | $default_path = AUTO_LOAD_NEXT_POST_FILE_PATH; |
42 | 42 | |
43 | - if ( file_exists( $child_path . 'content-partial.php' ) ) { |
|
44 | - include( $child_path . 'content-partial.php' ); |
|
43 | + if (file_exists($child_path.'content-partial.php')) { |
|
44 | + include($child_path.'content-partial.php'); |
|
45 | 45 | } |
46 | - else if( file_exists( $template_path . 'content-partial.php') ) { |
|
47 | - include( $template_path . 'content-partial.php' ); |
|
46 | + else if (file_exists($template_path.'content-partial.php')) { |
|
47 | + include($template_path.'content-partial.php'); |
|
48 | 48 | } |
49 | - else if( file_exists( $default_path . '/template/content-partial.php' ) ) { |
|
50 | - include( $default_path . '/template/content-partial.php' ); |
|
49 | + else if (file_exists($default_path.'/template/content-partial.php')) { |
|
50 | + include($default_path.'/template/content-partial.php'); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | exit; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | function auto_load_next_post_comments() { |
63 | 63 | // If comments are open or we have at least one comment, load up the comment template. |
64 | - if ( comments_open() || get_comments_number() ) : |
|
64 | + if (comments_open() || get_comments_number()) : |
|
65 | 65 | comments_template(); |
66 | 66 | endif; |
67 | 67 | } |
@@ -42,11 +42,9 @@ |
||
42 | 42 | |
43 | 43 | if ( file_exists( $child_path . 'content-partial.php' ) ) { |
44 | 44 | include( $child_path . 'content-partial.php' ); |
45 | - } |
|
46 | - else if( file_exists( $template_path . 'content-partial.php') ) { |
|
45 | + } else if( file_exists( $template_path . 'content-partial.php') ) { |
|
47 | 46 | include( $template_path . 'content-partial.php' ); |
48 | - } |
|
49 | - else if( file_exists( $default_path . '/template/content-partial.php' ) ) { |
|
47 | + } else if( file_exists( $default_path . '/template/content-partial.php' ) ) { |
|
50 | 48 | include( $default_path . '/template/content-partial.php' ); |
51 | 49 | } |
52 | 50 |
@@ -69,7 +69,7 @@ |
||
69 | 69 | function alnp_template_location() { |
70 | 70 | $current_theme = get_option('template'); |
71 | 71 | |
72 | - switch( $current_theme ) { |
|
72 | + switch ($current_theme) { |
|
73 | 73 | case 'twentyseventeen': |
74 | 74 | $path = 'template-parts/post/'; |
75 | 75 | break; |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | |
8 | 8 | $template_location = apply_filters('alnp_template_location', ''); // e.g. "template-parts/post/" |
9 | 9 | |
10 | -if ( have_posts() ) : |
|
10 | +if (have_posts()) : |
|
11 | 11 | |
12 | 12 | // Load content before the loop. |
13 | 13 | do_action('alnp_load_before_loop'); |
@@ -25,14 +25,14 @@ discard block |
||
25 | 25 | |
26 | 26 | if (false === $post_format) { |
27 | 27 | // Include the standard content.php file. |
28 | - get_template_part($template_location . 'content'); |
|
28 | + get_template_part($template_location.'content'); |
|
29 | 29 | } else { |
30 | 30 | // Include the post format content. |
31 | - if (locate_template($template_location . 'format-'.$post_format.'.php') != '') { |
|
32 | - get_template_part($template_location . 'format', $post_format); |
|
31 | + if (locate_template($template_location.'format-'.$post_format.'.php') != '') { |
|
32 | + get_template_part($template_location.'format', $post_format); |
|
33 | 33 | } else { |
34 | 34 | // If no format-{post-format}.php file found then fallback to content-{post-format}.php |
35 | - get_template_part($template_location . 'content', $post_format); |
|
35 | + get_template_part($template_location.'content', $post_format); |
|
36 | 36 | } |
37 | 37 | } |
38 | 38 |
@@ -48,9 +48,11 @@ |
||
48 | 48 | // Load content after the loop. |
49 | 49 | do_action('alnp_load_after_loop'); |
50 | 50 | |
51 | -else : |
|
51 | +else { |
|
52 | + : |
|
52 | 53 | |
53 | 54 | // Load content if there are no more posts. |
54 | 55 | do_action('alnp_no_more_posts'); |
56 | +} |
|
55 | 57 | |
56 | 58 | endif; // END if have_posts() |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | exit; // Exit if accessed directly. |
32 | 32 | } |
33 | 33 | |
34 | -if ( ! class_exists('Auto_Load_Next_Post') ) { |
|
34 | +if ( ! class_exists('Auto_Load_Next_Post')) { |
|
35 | 35 | |
36 | 36 | /** |
37 | 37 | * Main Auto Load Next Post Class |
@@ -220,9 +220,9 @@ discard block |
||
220 | 220 | * @version 1.4.8 |
221 | 221 | */ |
222 | 222 | public function load_plugin_textdomain() { |
223 | - $locale = apply_filters( 'plugin_locale', get_locale(), 'auto-load-next-post' ); |
|
224 | - load_textdomain( 'auto-load-next-post', WP_LANG_DIR . '/auto-load-next-post/auto-load-next-post-' . $locale . '.mo' ); |
|
225 | - load_plugin_textdomain( 'auto-load-next-post', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' ); |
|
223 | + $locale = apply_filters('plugin_locale', get_locale(), 'auto-load-next-post'); |
|
224 | + load_textdomain('auto-load-next-post', WP_LANG_DIR.'/auto-load-next-post/auto-load-next-post-'.$locale.'.mo'); |
|
225 | + load_plugin_textdomain('auto-load-next-post', false, plugin_basename(dirname(__FILE__)).'/languages'); |
|
226 | 226 | } // END load_plugin_textdomain() |
227 | 227 | |
228 | 228 | /** |