%PDF- %PDF-
Direktori : /var/www/html/higroup/wp-content/themes/evenex/core/hooks/ |
Current File : /var/www/html/higroup/wp-content/themes/evenex/core/hooks/blog.php |
<?php if (!defined('ABSPATH')) die('Direct access forbidden.'); /** * hooks for wp blog part */ // if there is no excerpt, sets a defult placeholder // ---------------------------------------------------------------------------------------- function evenex_excerpt( $words = 20 ) { $excerpt = get_the_excerpt(); $trimmed_content = wp_trim_words( $excerpt, $words ); echo evenex_kses( $trimmed_content ); } // change textarea position in comment form // ---------------------------------------------------------------------------------------- function evenex_move_comment_textarea_to_bottom( $fields ) { $comment_field = $fields[ 'comment' ]; unset( $fields[ 'comment' ] ); $fields[ 'comment' ] = $comment_field; return $fields; } add_filter( 'comment_form_fields', 'evenex_move_comment_textarea_to_bottom' ); // change textarea position in comment form // ---------------------------------------------------------------------------------------- function evenex_search_form( $form ) { $form = ' <form method="get" action="' . esc_url( home_url( '/' ) ) . '" class="evenex-serach xs-search-group"> <div class="input-group"> <input type="search" class="form-control" name="s" placeholder="' .esc_attr__( 'Search', 'evenex' ) . '" value="' . get_search_query() . '"> <div class="input-group-append"> <button class="input-group-text search-button"><i class="fas fa-search"></i></button> </div> </div> </form>'; return $form; } add_filter( 'get_search_form', 'evenex_search_form' ); function evenex_body_classes( $classes ) { if ( is_active_sidebar( 'sidebar-1' ) ) { $classes[] = 'sidebar-active'; }else{ $classes[] = 'sidebar-inactive'; } $box_class = evenex_option('general_body_box_layout'); if(isset($box_class['style'])){ if($box_class['style']=='yes'){ $classes[] = 'body-box-layout'; } } return $classes; } add_filter( 'body_class','evenex_body_classes' );