%s does not exist.', $located ), '2.1' ); return; } // Allow 3rd party plugin filter template file from their plugin $located = apply_filters( 'alagu_get_template', $located, $template_name, $args, $template_path, $default_path ); do_action( 'alagu_before_template_part', $template_name, $template_path, $located, $args ); if ( $located && file_exists( $located ) ) { include $located; } do_action( 'alagu_after_template_part', $template_name, $template_path, $located, $args ); } } // Locate Template if( !function_exists( 'alagu_locate_template' ) ) { function alagu_locate_template( $template_name, $template_path = '', $default_path = '' ) { if ( !$template_path ) { $template_path = alagu_template_path(); } if ( !$default_path ) { $default_path = ALAGU_THEME_URI . '/framework/templates/'; } $template = null; // Look within passed path within the theme - this is priority $template = locate_template( array( trailingslashit( $template_path ) . $template_name, $template_name ) ); // Get default template if ( !$template ) { $template = $default_path . $template_name; } // Return what we found return apply_filters( 'alagu_locate_template', $template, $template_name, $template_path ); } }