is_infinite_scroll() ) { $excerpt_default = hestia_get_excerpt_default(); return get_theme_mod( 'hestia_excerpt_length', $excerpt_default ); } else { return 50; } } /** * Replace excerpt "Read More" text with a link. * * @param string $more [...]. * * @return string * @since Hestia 1.0 */ public function change_excerpt_more( $more ) { global $post; $custom_more_tag = ' ' . esc_html__( 'Read more', 'hestia' ) . '…'; if ( 'page' === get_option( 'show_on_front' ) && is_front_page() ) { return $custom_more_tag; } $blog_layout = get_theme_mod( 'hestia_alternative_blog_layout', 'blog_normal_layout' ); if ( ( is_home() || $this->is_infinite_scroll() ) && $blog_layout === 'blog_alternative_layout2' ) { return ' ...'; } if ( is_single() || is_archive() || is_home() || $this->is_infinite_scroll() ) { return $custom_more_tag; } return $more; } /** * Check if is infinite scroll. * * @return bool */ private function is_infinite_scroll() { return isset( $_POST['action'] ) && $_POST['action'] === 'infinite_scroll'; } /** * Move comment field above user details. * * @param array $fields comment form fields. * * @return array * @since Hestia 1.0 */ public function comment_message( $fields ) { if ( array_key_exists( 'comment', $fields ) ) { $comment_field = $fields['comment']; unset( $fields['comment'] ); $fields['comment'] = $comment_field; } if ( array_key_exists( 'cookies', $fields ) ) { $cookie_field = $fields['cookies']; unset( $fields['cookies'] ); $fields['cookies'] = $cookie_field; } return $fields; } /** * Add markup to comment form fields. * * @param array $fields Comment form fields. * * @return array */ public function comment_form_args( $fields ) { $req = get_option( 'require_name_email' ); $aria_req = ( $req ? " aria-required='true'" : '' ); $fields['author'] = '