is_main_query() ) { return; } if ( is_search() ) { $query->set( 'posts_per_page', 20 ); } } add_action( 'pre_get_posts', 'aperitto_pre_get_posts' ); /** * @param $args * * @return mixed * ========================================================================== */ function aperitto_comment_form_defaults( $args ) { $commenter = wp_get_current_commenter(); $consent = empty( $commenter['comment_author_email'] ) ? '' : ' checked="checked"'; $fields = apply_filters( 'aperitto_comment_form_defaults', array( 'author' => '
', 'email' => '', 'url' => '', 'cookies' => '', ) ); $args['fields'] = apply_filters( 'comment_form_default_fields', $fields ); $args['comment_field'] = ''; return $args; } add_filter( 'comment_form_defaults', 'aperitto_comment_form_defaults', 10 ); /** * customize excerpt text * * @param $more * * @return string * ========================================================================== */ function aperitto_change_the_excerpt( $more ) { return ' ...'; } add_action( 'excerpt_more', 'aperitto_change_the_excerpt' ); /* ========================================================================== * echo custom script in footer from options * ========================================================================== */ function aperitto_singular_thumbnail_attr( $args ) { $show_mobile_thumb = get_theme_mod( 'show_mobile_thumb' ); if ( ! empty( $show_mobile_thumb ) ) { $old = ( array_key_exists( 'class', $args ) ) ? $args['class'] : ''; $args['class'] = "$old show"; } return $args; } apply_filters( 'aperitto_singular_thumbnail_attr', 'aperitto_singular_thumbnail_attr' ); /* ========================================================================== * * Wrap content with entry class * ========================================================================== */ if ( ! function_exists( 'aperitto_the_content_entry' ) ) : function aperitto_the_content_entry( $content ) { return '