@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | * |
| 26 | 26 | * The main instance of the plugin. |
| 27 | 27 | */ |
| 28 | -if ( ! class_exists( 'Auto_Load_Next_Post' ) ) { |
|
| 28 | +if ( ! class_exists('Auto_Load_Next_Post')) { |
|
| 29 | 29 | |
| 30 | 30 | class Auto_Load_Next_Post { |
| 31 | 31 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | * @return Auto_Load_Next_Post Single instance. |
| 60 | 60 | */ |
| 61 | 61 | public static function instance() { |
| 62 | - if ( is_null( self::$_instance ) ) { |
|
| 62 | + if (is_null(self::$_instance)) { |
|
| 63 | 63 | self::$_instance = new self(); |
| 64 | 64 | } |
| 65 | 65 | return self::$_instance; |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public function __clone() { |
| 76 | 76 | // Cloning instances of the class is forbidden |
| 77 | - _doing_it_wrong( __FUNCTION__, __( 'Cloning this object is forbidden.', 'auto-load-next-post' ), self::$version ); |
|
| 77 | + _doing_it_wrong(__FUNCTION__, __('Cloning this object is forbidden.', 'auto-load-next-post'), self::$version); |
|
| 78 | 78 | } // END __clone() |
| 79 | 79 | |
| 80 | 80 | /** |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | * @return void |
| 86 | 86 | */ |
| 87 | 87 | public function __wakeup() { |
| 88 | - _doing_it_wrong( __FUNCTION__, __( 'Unserializing instances of this class is forbidden.', 'auto-load-next-post' ), self::$version ); |
|
| 88 | + _doing_it_wrong(__FUNCTION__, __('Unserializing instances of this class is forbidden.', 'auto-load-next-post'), self::$version); |
|
| 89 | 89 | } // END __wakeup() |
| 90 | 90 | |
| 91 | 91 | /** |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | $this->init_hooks(); |
| 102 | 102 | |
| 103 | 103 | // Auto Load Next Post is fully loaded. |
| 104 | - do_action( 'auto_load_next_post_loaded' ); |
|
| 104 | + do_action('auto_load_next_post_loaded'); |
|
| 105 | 105 | } // END __construct() |
| 106 | 106 | |
| 107 | 107 | /** |
@@ -112,10 +112,10 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | public function init_hooks() { |
| 114 | 114 | // Load translation files. |
| 115 | - add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); |
|
| 115 | + add_action('init', array($this, 'load_plugin_textdomain')); |
|
| 116 | 116 | |
| 117 | 117 | // Load Auto Load Next Post scripts on the frontend. |
| 118 | - add_action( 'wp_enqueue_scripts', array( $this, 'alnp_enqueue_scripts' ) ); |
|
| 118 | + add_action('wp_enqueue_scripts', array($this, 'alnp_enqueue_scripts')); |
|
| 119 | 119 | } // END init_hooks() |
| 120 | 120 | |
| 121 | 121 | /** |
@@ -130,10 +130,10 @@ discard block |
||
| 130 | 130 | $this->define('AUTO_LOAD_NEXT_POST_FILE', __FILE__); |
| 131 | 131 | $this->define('AUTO_LOAD_NEXT_POST_SLUG', 'auto-load-next-post'); |
| 132 | 132 | |
| 133 | - $this->define('AUTO_LOAD_NEXT_POST_URL_PATH', untrailingslashit( plugins_url( '/', __FILE__ ) ) ); |
|
| 134 | - $this->define('AUTO_LOAD_NEXT_POST_FILE_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) ); |
|
| 133 | + $this->define('AUTO_LOAD_NEXT_POST_URL_PATH', untrailingslashit(plugins_url('/', __FILE__))); |
|
| 134 | + $this->define('AUTO_LOAD_NEXT_POST_FILE_PATH', untrailingslashit(plugin_dir_path(__FILE__))); |
|
| 135 | 135 | $this->define('AUTO_LOAD_NEXT_POST_TEMPLATE_PATH', 'auto-load-next-post/'); |
| 136 | - $this->define('AUTO_LOAD_NEXT_POST_3RD_PARTY', AUTO_LOAD_NEXT_POST_FILE_PATH . '/includes/3rd-party/'); |
|
| 136 | + $this->define('AUTO_LOAD_NEXT_POST_3RD_PARTY', AUTO_LOAD_NEXT_POST_FILE_PATH.'/includes/3rd-party/'); |
|
| 137 | 137 | |
| 138 | 138 | $this->define('AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE', '4.4'); |
| 139 | 139 | |
@@ -158,9 +158,9 @@ discard block |
||
| 158 | 158 | * @param string $name |
| 159 | 159 | * @param string|bool $value |
| 160 | 160 | */ |
| 161 | - private function define( $name, $value ) { |
|
| 162 | - if ( ! defined( $name ) ) { |
|
| 163 | - define( $name, $value ); |
|
| 161 | + private function define($name, $value) { |
|
| 162 | + if ( ! defined($name)) { |
|
| 163 | + define($name, $value); |
|
| 164 | 164 | } |
| 165 | 165 | } // END define() |
| 166 | 166 | |
@@ -173,35 +173,35 @@ discard block |
||
| 173 | 173 | * @return void |
| 174 | 174 | */ |
| 175 | 175 | public function includes() { |
| 176 | - include_once( dirname( __FILE__ ) . '/includes/class-alnp-autoloader.php' ); // Autoloader. |
|
| 177 | - include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-deprecated-functions.php' ); // Deprecated functions. |
|
| 178 | - include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-conditional-functions.php' ); // Conditional functions. |
|
| 179 | - include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-formatting-functions.php' ); // Formatting functions. |
|
| 180 | - include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-themes-supported.php' ); // Handles all supported themes out of the box. |
|
| 181 | - include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-core-functions.php' ); // Contains core functions for the front/back end. |
|
| 182 | - include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-template-functions.php' ); // Template Functions |
|
| 183 | - include_once( dirname( __FILE__ ) . '/includes/auto-load-next-post-template-hooks.php' ); // Template Hooks |
|
| 176 | + include_once(dirname(__FILE__).'/includes/class-alnp-autoloader.php'); // Autoloader. |
|
| 177 | + include_once(dirname(__FILE__).'/includes/auto-load-next-post-deprecated-functions.php'); // Deprecated functions. |
|
| 178 | + include_once(dirname(__FILE__).'/includes/auto-load-next-post-conditional-functions.php'); // Conditional functions. |
|
| 179 | + include_once(dirname(__FILE__).'/includes/auto-load-next-post-formatting-functions.php'); // Formatting functions. |
|
| 180 | + include_once(dirname(__FILE__).'/includes/auto-load-next-post-themes-supported.php'); // Handles all supported themes out of the box. |
|
| 181 | + include_once(dirname(__FILE__).'/includes/auto-load-next-post-core-functions.php'); // Contains core functions for the front/back end. |
|
| 182 | + include_once(dirname(__FILE__).'/includes/auto-load-next-post-template-functions.php'); // Template Functions |
|
| 183 | + include_once(dirname(__FILE__).'/includes/auto-load-next-post-template-hooks.php'); // Template Hooks |
|
| 184 | 184 | |
| 185 | 185 | // Include theme support. |
| 186 | 186 | alnp_include_theme_support(); |
| 187 | 187 | |
| 188 | 188 | // 3rd Party support. |
| 189 | - include_once( dirname( __FILE__ ) . '/includes/3rd-party/3rd-party.php' ); |
|
| 189 | + include_once(dirname(__FILE__).'/includes/3rd-party/3rd-party.php'); |
|
| 190 | 190 | |
| 191 | 191 | // Customizer. |
| 192 | - include_once( dirname( __FILE__ ) . '/includes/customizer/class-alnp-customizer.php' ); |
|
| 193 | - include_once( dirname( __FILE__ ) . '/includes/customizer/class-alnp-customizer-scripts.php' ); |
|
| 192 | + include_once(dirname(__FILE__).'/includes/customizer/class-alnp-customizer.php'); |
|
| 193 | + include_once(dirname(__FILE__).'/includes/customizer/class-alnp-customizer-scripts.php'); |
|
| 194 | 194 | |
| 195 | 195 | // Ajax |
| 196 | - include_once( dirname( __FILE__ ) . '/includes/class-alnp-ajax.php' ); |
|
| 196 | + include_once(dirname(__FILE__).'/includes/class-alnp-ajax.php'); |
|
| 197 | 197 | |
| 198 | 198 | // Include admin class to handle all back-end functions. |
| 199 | - if ( is_admin() ) { |
|
| 200 | - include_once( dirname( __FILE__ ) . '/includes/admin/class-alnp-admin.php' ); |
|
| 199 | + if (is_admin()) { |
|
| 200 | + include_once(dirname(__FILE__).'/includes/admin/class-alnp-admin.php'); |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | // Install. |
| 204 | - require_once( dirname( __FILE__ ) . '/includes/class-alnp-install.php' ); |
|
| 204 | + require_once(dirname(__FILE__).'/includes/class-alnp-install.php'); |
|
| 205 | 205 | } // END includes() |
| 206 | 206 | |
| 207 | 207 | /** |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | * @return void |
| 217 | 217 | */ |
| 218 | 218 | public function load_plugin_textdomain() { |
| 219 | - load_plugin_textdomain( 'auto-load-next-post', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); |
|
| 219 | + load_plugin_textdomain('auto-load-next-post', false, dirname(plugin_basename(__FILE__)).'/languages/'); |
|
| 220 | 220 | } // END load_plugin_textdomain() |
| 221 | 221 | |
| 222 | 222 | /** |
@@ -228,43 +228,43 @@ discard block |
||
| 228 | 228 | */ |
| 229 | 229 | public function alnp_enqueue_scripts() { |
| 230 | 230 | // Prevent enqueue scripts if feed, trackback or a preview of a post. |
| 231 | - if ( is_feed() || is_trackback() || is_preview() ) { |
|
| 231 | + if (is_feed() || is_trackback() || is_preview()) { |
|
| 232 | 232 | return; |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | // Load the Javascript if found as a singluar post and the user is not a bot. |
| 236 | - if ( ! alnp_is_bot() && is_singular() && get_post_type() == 'post' ) { |
|
| 236 | + if ( ! alnp_is_bot() && is_singular() && get_post_type() == 'post') { |
|
| 237 | 237 | // This checks to see if the JavaScript should load in the footer or not. |
| 238 | 238 | $load_in_footer = alnp_load_js_in_footer(); |
| 239 | 239 | |
| 240 | 240 | // This checks to see if we should disable Auto Load Next Post from running on mobile devices. |
| 241 | 241 | $disable_mobile = alnp_disable_on_mobile(); |
| 242 | 242 | |
| 243 | - $this->load_file( 'auto-load-next-post-scrollspy', '/assets/js/libs/scrollspy.min.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION, $load_in_footer ); |
|
| 243 | + $this->load_file('auto-load-next-post-scrollspy', '/assets/js/libs/scrollspy.min.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION, $load_in_footer); |
|
| 244 | 244 | |
| 245 | 245 | // Only load History.js when not in the customizer. |
| 246 | - if ( ! is_customize_preview() ) { |
|
| 247 | - $this->load_file( 'auto-load-next-post-history', '/assets/js/libs/jquery.history.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION, $load_in_footer ); |
|
| 246 | + if ( ! is_customize_preview()) { |
|
| 247 | + $this->load_file('auto-load-next-post-history', '/assets/js/libs/jquery.history.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION, $load_in_footer); |
|
| 248 | 248 | } |
| 249 | 249 | |
| 250 | - $this->load_file( 'auto-load-next-post-script', '/assets/js/frontend/auto-load-next-post' . AUTO_LOAD_NEXT_POST_DEBUG_MODE.AUTO_LOAD_NEXT_POST_SCRIPT_MODE . '.js', true, array('auto-load-next-post-scrollspy'), AUTO_LOAD_NEXT_POST_VERSION, $load_in_footer ); |
|
| 250 | + $this->load_file('auto-load-next-post-script', '/assets/js/frontend/auto-load-next-post'.AUTO_LOAD_NEXT_POST_DEBUG_MODE.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.js', true, array('auto-load-next-post-scrollspy'), AUTO_LOAD_NEXT_POST_VERSION, $load_in_footer); |
|
| 251 | 251 | |
| 252 | 252 | // Variables for the JavaScript |
| 253 | - wp_localize_script( 'auto-load-next-post-script', 'auto_load_next_post_params', array( |
|
| 253 | + wp_localize_script('auto-load-next-post-script', 'auto_load_next_post_params', array( |
|
| 254 | 254 | 'alnp_version' => AUTO_LOAD_NEXT_POST_VERSION, |
| 255 | - 'alnp_content_container' => get_option( 'auto_load_next_post_content_container' ), |
|
| 256 | - 'alnp_title_selector' => get_option( 'auto_load_next_post_title_selector' ), |
|
| 257 | - 'alnp_navigation_container' => get_option( 'auto_load_next_post_navigation_container' ), |
|
| 258 | - 'alnp_comments_container' => get_option( 'auto_load_next_post_comments_container' ), |
|
| 259 | - 'alnp_remove_comments' => get_option( 'auto_load_next_post_remove_comments' ), |
|
| 260 | - 'alnp_google_analytics' => get_option( 'auto_load_next_post_google_analytics' ), |
|
| 261 | - 'alnp_event_on_load' => get_option( 'auto_load_next_post_on_load_event' ), |
|
| 262 | - 'alnp_event_on_entering' => get_option( 'auto_load_next_post_on_entering_event' ), |
|
| 255 | + 'alnp_content_container' => get_option('auto_load_next_post_content_container'), |
|
| 256 | + 'alnp_title_selector' => get_option('auto_load_next_post_title_selector'), |
|
| 257 | + 'alnp_navigation_container' => get_option('auto_load_next_post_navigation_container'), |
|
| 258 | + 'alnp_comments_container' => get_option('auto_load_next_post_comments_container'), |
|
| 259 | + 'alnp_remove_comments' => get_option('auto_load_next_post_remove_comments'), |
|
| 260 | + 'alnp_google_analytics' => get_option('auto_load_next_post_google_analytics'), |
|
| 261 | + 'alnp_event_on_load' => get_option('auto_load_next_post_on_load_event'), |
|
| 262 | + 'alnp_event_on_entering' => get_option('auto_load_next_post_on_entering_event'), |
|
| 263 | 263 | 'alnp_is_customizer' => $this->is_alnp_using_customizer(), |
| 264 | 264 | 'alnp_load_in_footer' => $load_in_footer, |
| 265 | 265 | 'alnp_is_mobile' => $this->is_mobile(), |
| 266 | 266 | 'alnp_disable_mobile' => $disable_mobile |
| 267 | - ) ); |
|
| 267 | + )); |
|
| 268 | 268 | } // END if is_singular() && get_post_type() |
| 269 | 269 | } // END alnp_enqueue_scripts() |
| 270 | 270 | |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | * @return string|bool |
| 278 | 278 | */ |
| 279 | 279 | public static function is_alnp_using_customizer() { |
| 280 | - if ( is_customize_preview() ) { |
|
| 280 | + if (is_customize_preview()) { |
|
| 281 | 281 | return "yes"; |
| 282 | 282 | } |
| 283 | 283 | |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | * @return string|bool |
| 294 | 294 | */ |
| 295 | 295 | public static function is_mobile() { |
| 296 | - if ( wp_is_mobile() ) { |
|
| 296 | + if (wp_is_mobile()) { |
|
| 297 | 297 | return "yes"; |
| 298 | 298 | } |
| 299 | 299 | |
@@ -314,19 +314,19 @@ discard block |
||
| 314 | 314 | * @param string $version Optional, can match the version of the plugin or version of the source file. |
| 315 | 315 | * @param bool $footer Optional, can set the JavaScript to load in the footer instead. |
| 316 | 316 | */ |
| 317 | - public static function load_file( $name, $file_path, $is_script = false, $support = array(), $version = '', $footer = false ) { |
|
| 318 | - $url = AUTO_LOAD_NEXT_POST_URL_PATH . $file_path; // URL to the file. |
|
| 319 | - |
|
| 320 | - if ( file_exists( AUTO_LOAD_NEXT_POST_FILE_PATH . $file_path ) ) { |
|
| 321 | - if ( $is_script ) { |
|
| 322 | - if ( !wp_script_is( $name, 'registered' ) ) { |
|
| 323 | - wp_register_script( $name, $url, $support, $version, $footer ); |
|
| 324 | - wp_enqueue_script( $name ); |
|
| 317 | + public static function load_file($name, $file_path, $is_script = false, $support = array(), $version = '', $footer = false) { |
|
| 318 | + $url = AUTO_LOAD_NEXT_POST_URL_PATH.$file_path; // URL to the file. |
|
| 319 | + |
|
| 320 | + if (file_exists(AUTO_LOAD_NEXT_POST_FILE_PATH.$file_path)) { |
|
| 321 | + if ($is_script) { |
|
| 322 | + if ( ! wp_script_is($name, 'registered')) { |
|
| 323 | + wp_register_script($name, $url, $support, $version, $footer); |
|
| 324 | + wp_enqueue_script($name); |
|
| 325 | 325 | } |
| 326 | 326 | } else { |
| 327 | - if ( !wp_style_is( $name, 'registered' ) ) { |
|
| 328 | - wp_register_style( $name, $url ); |
|
| 329 | - wp_enqueue_style( $name ); |
|
| 327 | + if ( ! wp_style_is($name, 'registered')) { |
|
| 328 | + wp_register_style($name, $url); |
|
| 329 | + wp_enqueue_style($name); |
|
| 330 | 330 | } |
| 331 | 331 | } // end if |
| 332 | 332 | } // end if |
@@ -12,13 +12,13 @@ discard block |
||
| 12 | 12 | ?> |
| 13 | 13 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
| 14 | 14 | <header class="entry-header"> |
| 15 | - <?php the_title( '<h1 class="entry-title h1">', '</h1>' ); ?> |
|
| 15 | + <?php the_title('<h1 class="entry-title h1">', '</h1>'); ?> |
|
| 16 | 16 | </header><!-- .entry-header --> |
| 17 | 17 | |
| 18 | - <?php if ( has_post_thumbnail() ) : ?> |
|
| 18 | + <?php if (has_post_thumbnail()) : ?> |
|
| 19 | 19 | <figure class="post-thumbnail"> |
| 20 | 20 | <div class="post-thumbnail-inner"> |
| 21 | - <?php the_post_thumbnail( 'post-thumbnail' ); ?> |
|
| 21 | + <?php the_post_thumbnail('post-thumbnail'); ?> |
|
| 22 | 22 | </div> |
| 23 | 23 | </figure><!-- .post-thumbnail --> |
| 24 | 24 | <?php endif; ?> |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | wp_link_pages( |
| 31 | 31 | array( |
| 32 | - 'before' => '<div class="page-links">' . __( 'Pages:', 'auto-load-next-post' ), |
|
| 32 | + 'before' => '<div class="page-links">'.__('Pages:', 'auto-load-next-post'), |
|
| 33 | 33 | 'after' => '</div>', |
| 34 | 34 | ) |
| 35 | 35 | ); |
@@ -8,40 +8,40 @@ |
||
| 8 | 8 | * @version 1.6.0 |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -if ( have_posts() ) : |
|
| 11 | +if (have_posts()) : |
|
| 12 | 12 | |
| 13 | 13 | // Load content before the loop. |
| 14 | - do_action( 'alnp_load_before_loop' ); |
|
| 14 | + do_action('alnp_load_before_loop'); |
|
| 15 | 15 | |
| 16 | 16 | // Check that there are more posts to load. |
| 17 | - while ( have_posts() ) : the_post(); |
|
| 17 | + while (have_posts()) : the_post(); |
|
| 18 | 18 | |
| 19 | 19 | $post_type = alnp_get_post_type(); // Post Type e.g. single |
| 20 | 20 | |
| 21 | 21 | // Load content before the post content. |
| 22 | - do_action( 'alnp_load_before_content' ); |
|
| 22 | + do_action('alnp_load_before_content'); |
|
| 23 | 23 | |
| 24 | 24 | // Load content before the post content for a specific post type. |
| 25 | - do_action( 'alnp_load_before_content_post_type_' . $post_type ); |
|
| 25 | + do_action('alnp_load_before_content_post_type_'.$post_type); |
|
| 26 | 26 | |
| 27 | 27 | // Load Make partial template for the correct post type. |
| 28 | - get_template_part( 'partials/content', $post_type ); |
|
| 28 | + get_template_part('partials/content', $post_type); |
|
| 29 | 29 | |
| 30 | 30 | // Load content after the post content for a specific post type. |
| 31 | - do_action( 'alnp_load_after_content_post_type_' . $post_type ); |
|
| 31 | + do_action('alnp_load_after_content_post_type_'.$post_type); |
|
| 32 | 32 | |
| 33 | 33 | // Load content before the post content. |
| 34 | - do_action( 'alnp_load_after_content' ); |
|
| 34 | + do_action('alnp_load_after_content'); |
|
| 35 | 35 | |
| 36 | 36 | // End the loop. |
| 37 | 37 | endwhile; |
| 38 | 38 | |
| 39 | 39 | // Load content after the loop. |
| 40 | - do_action( 'alnp_load_after_loop' ); |
|
| 40 | + do_action('alnp_load_after_loop'); |
|
| 41 | 41 | |
| 42 | 42 | else : |
| 43 | 43 | |
| 44 | 44 | // Load content if there are no more posts. |
| 45 | - do_action( 'alnp_no_more_posts' ); |
|
| 45 | + do_action('alnp_no_more_posts'); |
|
| 46 | 46 | |
| 47 | 47 | endif; // END if have_posts() |
@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
| 2 | 2 | <header class="entry-header"> |
| 3 | - <?php get_template_part( 'template-parts/header/entry', 'header' ); ?> |
|
| 3 | + <?php get_template_part('template-parts/header/entry', 'header'); ?> |
|
| 4 | 4 | </header> |
| 5 | 5 | |
| 6 | 6 | <figure class="post-thumbnail"> |
| 7 | 7 | <div class="post-thumbnail-inner"> |
| 8 | - <?php the_post_thumbnail( 'post-thumbnail' ); ?> |
|
| 8 | + <?php the_post_thumbnail('post-thumbnail'); ?> |
|
| 9 | 9 | </div> |
| 10 | 10 | </figure> |
| 11 | 11 | |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | wp_link_pages( |
| 17 | 17 | array( |
| 18 | - 'before' => '<div class="page-links">' . __( 'Pages:', 'auto-load-next-post' ), |
|
| 18 | + 'before' => '<div class="page-links">'.__('Pages:', 'auto-load-next-post'), |
|
| 19 | 19 | 'after' => '</div>', |
| 20 | 20 | ) |
| 21 | 21 | ); |
@@ -26,8 +26,8 @@ discard block |
||
| 26 | 26 | <?php twentynineteen_entry_footer(); ?> |
| 27 | 27 | </footer><!-- .entry-footer --> |
| 28 | 28 | |
| 29 | - <?php if ( ! is_singular( 'attachment' ) ) : ?> |
|
| 30 | - <?php get_template_part( 'template-parts/post/author', 'bio' ); ?> |
|
| 29 | + <?php if ( ! is_singular('attachment')) : ?> |
|
| 30 | + <?php get_template_part('template-parts/post/author', 'bio'); ?> |
|
| 31 | 31 | <?php endif; ?> |
| 32 | 32 | |
| 33 | 33 | </article><!-- #post-${ID} --> |
| 34 | 34 | \ No newline at end of file |
@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
| 2 | 2 | <header class="entry-header"> |
| 3 | - <?php get_template_part( 'template-parts/header/entry', 'header' ); ?> |
|
| 3 | + <?php get_template_part('template-parts/header/entry', 'header'); ?> |
|
| 4 | 4 | </header> |
| 5 | 5 | |
| 6 | 6 | <figure class="post-thumbnail"> |
| 7 | 7 | <div class="post-thumbnail-inner"> |
| 8 | - <?php the_post_thumbnail( 'post-thumbnail' ); ?> |
|
| 8 | + <?php the_post_thumbnail('post-thumbnail'); ?> |
|
| 9 | 9 | </div> |
| 10 | 10 | </figure> |
| 11 | 11 | |
@@ -15,21 +15,21 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | wp_link_pages( |
| 17 | 17 | array( |
| 18 | - 'before' => '<div class="page-links">' . __( 'Pages:', 'auto-load-next-post' ), |
|
| 18 | + 'before' => '<div class="page-links">'.__('Pages:', 'auto-load-next-post'), |
|
| 19 | 19 | 'after' => '</div>', |
| 20 | 20 | ) |
| 21 | 21 | ); |
| 22 | 22 | ?> |
| 23 | 23 | </div><!-- .entry-content --> |
| 24 | 24 | |
| 25 | - <?php if ( get_edit_post_link() ) : ?> |
|
| 25 | + <?php if (get_edit_post_link()) : ?> |
|
| 26 | 26 | <footer class="entry-footer"> |
| 27 | 27 | <?php |
| 28 | 28 | edit_post_link( |
| 29 | 29 | sprintf( |
| 30 | 30 | wp_kses( |
| 31 | 31 | /* translators: %s: Name of current post. Only visible to screen readers */ |
| 32 | - __( 'Edit <span class="screen-reader-text">%s</span>', 'auto-load-next-post' ), |
|
| 32 | + __('Edit <span class="screen-reader-text">%s</span>', 'auto-load-next-post'), |
|
| 33 | 33 | array( |
| 34 | 34 | 'span' => array( |
| 35 | 35 | 'class' => array(), |
@@ -8,41 +8,41 @@ |
||
| 8 | 8 | * @version 1.6.0 |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -if ( have_posts() ) : |
|
| 11 | +if (have_posts()) : |
|
| 12 | 12 | |
| 13 | 13 | // Load content before the loop. |
| 14 | - do_action( 'alnp_load_before_loop' ); |
|
| 14 | + do_action('alnp_load_before_loop'); |
|
| 15 | 15 | |
| 16 | 16 | // Check that there are posts to load. |
| 17 | - while ( have_posts() ) : the_post(); |
|
| 17 | + while (have_posts()) : the_post(); |
|
| 18 | 18 | |
| 19 | 19 | // Post Type e.g. single |
| 20 | 20 | $post_type = alnp_get_post_type(); |
| 21 | 21 | |
| 22 | 22 | // Load content before the post content. |
| 23 | - do_action( 'alnp_load_before_content' ); |
|
| 23 | + do_action('alnp_load_before_content'); |
|
| 24 | 24 | |
| 25 | 25 | // Load content before the post content for a specific post type. |
| 26 | - do_action( 'alnp_load_before_content_post_type_' . $post_type ); |
|
| 26 | + do_action('alnp_load_before_content_post_type_'.$post_type); |
|
| 27 | 27 | |
| 28 | 28 | // Get template for specific post type. |
| 29 | - include_once( 'content-' . $post_type . '.php' ); |
|
| 29 | + include_once('content-'.$post_type.'.php'); |
|
| 30 | 30 | |
| 31 | 31 | // Load content after the post content for a specific post type. |
| 32 | - do_action( 'alnp_load_after_content_post_type_' . $post_type ); |
|
| 32 | + do_action('alnp_load_after_content_post_type_'.$post_type); |
|
| 33 | 33 | |
| 34 | 34 | // Load content after the post content. |
| 35 | - do_action( 'alnp_load_after_content' ); |
|
| 35 | + do_action('alnp_load_after_content'); |
|
| 36 | 36 | |
| 37 | 37 | // End the loop. |
| 38 | 38 | endwhile; |
| 39 | 39 | |
| 40 | 40 | // Load content after the loop. |
| 41 | - do_action( 'alnp_load_after_loop' ); |
|
| 41 | + do_action('alnp_load_after_loop'); |
|
| 42 | 42 | |
| 43 | 43 | else : |
| 44 | 44 | |
| 45 | 45 | // Load content if there are no more posts. |
| 46 | - do_action( 'alnp_no_more_posts' ); |
|
| 46 | + do_action('alnp_no_more_posts'); |
|
| 47 | 47 | |
| 48 | 48 | endif; // END if have_posts() |
@@ -8,32 +8,32 @@ |
||
| 8 | 8 | * @version 1.6.0 |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -if ( have_posts() ) : |
|
| 11 | +if (have_posts()) : |
|
| 12 | 12 | |
| 13 | 13 | // Load content before the loop. |
| 14 | - do_action( 'alnp_load_before_loop' ); |
|
| 14 | + do_action('alnp_load_before_loop'); |
|
| 15 | 15 | |
| 16 | 16 | // Check that there are posts to load. |
| 17 | - while ( have_posts() ) : the_post(); |
|
| 17 | + while (have_posts()) : the_post(); |
|
| 18 | 18 | |
| 19 | 19 | // Load content before the post content. |
| 20 | - do_action( 'alnp_load_before_content' ); |
|
| 20 | + do_action('alnp_load_before_content'); |
|
| 21 | 21 | |
| 22 | 22 | // Load 'loop-templates/content-single.php' |
| 23 | - get_template_part( alnp_template_location() . 'content', 'single' ); |
|
| 23 | + get_template_part(alnp_template_location().'content', 'single'); |
|
| 24 | 24 | |
| 25 | 25 | // Load content after the post content. |
| 26 | - do_action( 'alnp_load_after_content' ); |
|
| 26 | + do_action('alnp_load_after_content'); |
|
| 27 | 27 | |
| 28 | 28 | // End the loop. |
| 29 | 29 | endwhile; |
| 30 | 30 | |
| 31 | 31 | // Load content after the loop. |
| 32 | - do_action( 'alnp_load_after_loop' ); |
|
| 32 | + do_action('alnp_load_after_loop'); |
|
| 33 | 33 | |
| 34 | 34 | else : |
| 35 | 35 | |
| 36 | 36 | // Load content if there are no more posts. |
| 37 | - do_action( 'alnp_no_more_posts' ); |
|
| 37 | + do_action('alnp_no_more_posts'); |
|
| 38 | 38 | |
| 39 | 39 | endif; // END if have_posts() |
@@ -8,22 +8,22 @@ discard block |
||
| 8 | 8 | * @version 1.6.0 |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -if ( have_posts() ) : |
|
| 11 | +if (have_posts()) : |
|
| 12 | 12 | |
| 13 | 13 | // Load content before the loop. |
| 14 | - do_action( 'alnp_load_before_loop' ); |
|
| 14 | + do_action('alnp_load_before_loop'); |
|
| 15 | 15 | |
| 16 | 16 | // Check that there are posts to load. |
| 17 | - while ( have_posts() ) : the_post(); |
|
| 17 | + while (have_posts()) : the_post(); |
|
| 18 | 18 | |
| 19 | 19 | // Load content before the post content. |
| 20 | - do_action( 'alnp_load_before_content' ); |
|
| 20 | + do_action('alnp_load_before_content'); |
|
| 21 | 21 | ?> |
| 22 | 22 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
| 23 | 23 | <header class="entry-header"> |
| 24 | 24 | <h1 class="entry-title"><?php the_title(); ?></h1> |
| 25 | 25 | |
| 26 | - <?php if ( 'post' == get_post_type() ) : ?> |
|
| 26 | + <?php if ('post' == get_post_type()) : ?> |
|
| 27 | 27 | <div class="entry-meta"> |
| 28 | 28 | <?php twentyeleven_posted_on(); ?> |
| 29 | 29 | </div><!-- .entry-meta --> |
@@ -32,49 +32,49 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | <div class="entry-content"> |
| 34 | 34 | <?php the_content(); ?> |
| 35 | - <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'auto-load-next-post' ), 'after' => '</div>' ) ); ?> |
|
| 35 | + <?php wp_link_pages(array('before' => '<div class="page-link">'.__('Pages:', 'auto-load-next-post'), 'after' => '</div>')); ?> |
|
| 36 | 36 | </div><!-- .entry-content --> |
| 37 | 37 | |
| 38 | 38 | <footer class="entry-meta"> |
| 39 | 39 | <?php |
| 40 | 40 | /* translators: used between list items, there is a space after the comma */ |
| 41 | - $categories_list = get_the_category_list( __( ', ', 'auto-load-next-post' ) ); |
|
| 41 | + $categories_list = get_the_category_list(__(', ', 'auto-load-next-post')); |
|
| 42 | 42 | |
| 43 | 43 | /* translators: used between list items, there is a space after the comma */ |
| 44 | - $tag_list = get_the_tag_list( '', __( ', ', 'auto-load-next-post' ) ); |
|
| 45 | - if ( '' != $tag_list ) { |
|
| 46 | - $utility_text = __( 'This entry was posted in %1$s and tagged %2$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'auto-load-next-post' ); |
|
| 47 | - } elseif ( '' != $categories_list ) { |
|
| 48 | - $utility_text = __( 'This entry was posted in %1$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'auto-load-next-post' ); |
|
| 44 | + $tag_list = get_the_tag_list('', __(', ', 'auto-load-next-post')); |
|
| 45 | + if ('' != $tag_list) { |
|
| 46 | + $utility_text = __('This entry was posted in %1$s and tagged %2$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'auto-load-next-post'); |
|
| 47 | + } elseif ('' != $categories_list) { |
|
| 48 | + $utility_text = __('This entry was posted in %1$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'auto-load-next-post'); |
|
| 49 | 49 | } else { |
| 50 | - $utility_text = __( 'This entry was posted by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'auto-load-next-post' ); |
|
| 50 | + $utility_text = __('This entry was posted by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'auto-load-next-post'); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | printf( |
| 54 | 54 | $utility_text, |
| 55 | 55 | $categories_list, |
| 56 | 56 | $tag_list, |
| 57 | - esc_url( get_permalink() ), |
|
| 58 | - the_title_attribute( 'echo=0' ), |
|
| 57 | + esc_url(get_permalink()), |
|
| 58 | + the_title_attribute('echo=0'), |
|
| 59 | 59 | get_the_author(), |
| 60 | - esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) |
|
| 60 | + esc_url(get_author_posts_url(get_the_author_meta('ID'))) |
|
| 61 | 61 | ); |
| 62 | 62 | ?> |
| 63 | 63 | |
| 64 | - <?php if ( get_the_author_meta( 'description' ) && ( ! function_exists( 'is_multi_author' ) || is_multi_author() ) ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries ?> |
|
| 64 | + <?php if (get_the_author_meta('description') && ( ! function_exists('is_multi_author') || is_multi_author())) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries ?> |
|
| 65 | 65 | <div id="author-info"> |
| 66 | 66 | <div id="author-avatar"> |
| 67 | 67 | <?php |
| 68 | 68 | /** This filter is documented in author.php */ |
| 69 | - echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 68 ) ); |
|
| 69 | + echo get_avatar(get_the_author_meta('user_email'), apply_filters('twentyeleven_author_bio_avatar_size', 68)); |
|
| 70 | 70 | ?> |
| 71 | 71 | </div><!-- #author-avatar --> |
| 72 | 72 | <div id="author-description"> |
| 73 | - <h2><?php printf( __( 'About %s', 'auto-load-next-post' ), get_the_author() ); ?></h2> |
|
| 74 | - <?php the_author_meta( 'description' ); ?> |
|
| 73 | + <h2><?php printf(__('About %s', 'auto-load-next-post'), get_the_author()); ?></h2> |
|
| 74 | + <?php the_author_meta('description'); ?> |
|
| 75 | 75 | <div id="author-link"> |
| 76 | - <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author"> |
|
| 77 | - <?php printf( __( 'View all posts by %s <span class="meta-nav">→</span>', 'auto-load-next-post' ), get_the_author() ); ?> |
|
| 76 | + <a href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))); ?>" rel="author"> |
|
| 77 | + <?php printf(__('View all posts by %s <span class="meta-nav">→</span>', 'auto-load-next-post'), get_the_author()); ?> |
|
| 78 | 78 | </a> |
| 79 | 79 | </div><!-- #author-link --> |
| 80 | 80 | </div><!-- #author-description --> |
@@ -84,17 +84,17 @@ discard block |
||
| 84 | 84 | </article><!-- #post-<?php the_ID(); ?> --> |
| 85 | 85 | <?php |
| 86 | 86 | // Load content after the post content. |
| 87 | - do_action( 'alnp_load_after_content' ); |
|
| 87 | + do_action('alnp_load_after_content'); |
|
| 88 | 88 | |
| 89 | 89 | // End the loop. |
| 90 | 90 | endwhile; |
| 91 | 91 | |
| 92 | 92 | // Load content after the loop. |
| 93 | - do_action( 'alnp_load_after_loop' ); |
|
| 93 | + do_action('alnp_load_after_loop'); |
|
| 94 | 94 | |
| 95 | 95 | else : |
| 96 | 96 | |
| 97 | 97 | // Load content if there are no more posts. |
| 98 | - do_action( 'alnp_no_more_posts' ); |
|
| 98 | + do_action('alnp_no_more_posts'); |
|
| 99 | 99 | |
| 100 | 100 | endif; // END if have_posts() |
@@ -8,16 +8,16 @@ discard block |
||
| 8 | 8 | * @version 1.6.0 |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -if ( have_posts() ) : |
|
| 11 | +if (have_posts()) : |
|
| 12 | 12 | |
| 13 | 13 | // Load content before the loop. |
| 14 | - do_action( 'alnp_load_before_loop' ); |
|
| 14 | + do_action('alnp_load_before_loop'); |
|
| 15 | 15 | |
| 16 | 16 | // Check that there are posts to load. |
| 17 | - while ( have_posts() ) : the_post(); |
|
| 17 | + while (have_posts()) : the_post(); |
|
| 18 | 18 | |
| 19 | 19 | // Load content before the post content. |
| 20 | - do_action( 'alnp_load_before_content' ); |
|
| 20 | + do_action('alnp_load_before_content'); |
|
| 21 | 21 | ?> |
| 22 | 22 | |
| 23 | 23 | <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
@@ -29,26 +29,26 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | <div class="entry-content"> |
| 31 | 31 | <?php the_content(); ?> |
| 32 | - <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'auto-load-next-post' ), 'after' => '</div>' ) ); ?> |
|
| 32 | + <?php wp_link_pages(array('before' => '<div class="page-link">'.__('Pages:', 'auto-load-next-post'), 'after' => '</div>')); ?> |
|
| 33 | 33 | </div><!-- .entry-content --> |
| 34 | 34 | |
| 35 | - <?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries ?> |
|
| 35 | + <?php if (get_the_author_meta('description')) : // If a user has filled out their description, show a bio on their entries ?> |
|
| 36 | 36 | <div id="entry-author-info"> |
| 37 | 37 | <div id="author-avatar"> |
| 38 | 38 | |
| 39 | 39 | <?php |
| 40 | 40 | /** This filter is documented in author.php */ |
| 41 | - echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); |
|
| 41 | + echo get_avatar(get_the_author_meta('user_email'), apply_filters('twentyten_author_bio_avatar_size', 60)); |
|
| 42 | 42 | ?> |
| 43 | 43 | </div><!-- #author-avatar --> |
| 44 | 44 | |
| 45 | 45 | <div id="author-description"> |
| 46 | 46 | |
| 47 | - <h2><?php printf( __( 'About %s', 'auto-load-next-post' ), get_the_author() ); ?></h2> |
|
| 48 | - <?php the_author_meta( 'description' ); ?> |
|
| 47 | + <h2><?php printf(__('About %s', 'auto-load-next-post'), get_the_author()); ?></h2> |
|
| 48 | + <?php the_author_meta('description'); ?> |
|
| 49 | 49 | <div id="author-link"> |
| 50 | - <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author"> |
|
| 51 | - <?php printf( __( 'View all posts by %s <span class="meta-nav">→</span>', 'auto-load-next-post' ), get_the_author() ); ?> |
|
| 50 | + <a href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))); ?>" rel="author"> |
|
| 51 | + <?php printf(__('View all posts by %s <span class="meta-nav">→</span>', 'auto-load-next-post'), get_the_author()); ?> |
|
| 52 | 52 | </a> |
| 53 | 53 | </div><!-- #author-link --> |
| 54 | 54 | |
@@ -64,22 +64,22 @@ discard block |
||
| 64 | 64 | </div><!-- #post-## --> |
| 65 | 65 | |
| 66 | 66 | <div id="nav-below" class="navigation"> |
| 67 | - <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'auto-load-next-post' ) . '</span> %title' ); ?></div> |
|
| 67 | + <div class="nav-previous"><?php previous_post_link('%link', '<span class="meta-nav">'._x('←', 'Previous post link', 'auto-load-next-post').'</span> %title'); ?></div> |
|
| 68 | 68 | </div><!-- #nav-below --> |
| 69 | 69 | |
| 70 | 70 | <?php |
| 71 | 71 | // Load content after the post content. |
| 72 | - do_action( 'alnp_load_after_content' ); |
|
| 72 | + do_action('alnp_load_after_content'); |
|
| 73 | 73 | |
| 74 | 74 | // End the loop. |
| 75 | 75 | endwhile; |
| 76 | 76 | |
| 77 | 77 | // Load content after the loop. |
| 78 | - do_action( 'alnp_load_after_loop' ); |
|
| 78 | + do_action('alnp_load_after_loop'); |
|
| 79 | 79 | |
| 80 | 80 | else : |
| 81 | 81 | |
| 82 | 82 | // Load content if there are no more posts. |
| 83 | - do_action( 'alnp_no_more_posts' ); |
|
| 83 | + do_action('alnp_no_more_posts'); |
|
| 84 | 84 | |
| 85 | 85 | endif; // END if have_posts() |