'; } } add_action( 'wp_head', 'amathambo_pingback_header' ); } if ( ! function_exists( 'amathambo_dynamic_widgets' ) ) { /** * Add dynamic widget areas in footer. */ function amathambo_dynamic_widgets() { $widget_area = sanitize_html_class( 'footer-widget-area' ); $widget = sanitize_html_class( 'widget-area-' ); $sidebar_prefix = 'footer-'; echo ''; } } // End if(). if ( ! function_exists( 'amathambo_custom_excerpt_length' ) ) { /** * Filter the except length to 25 words. * * @param int $length Excerpt length. * @return int (Maybe) modified excerpt length. */ function amathambo_custom_excerpt_length( $length ) { return 25; } add_filter( 'excerpt_length', 'amathambo_custom_excerpt_length', 999 ); /** * Change ending of excerpt. * * @param int $more excerpt ending. * @return string. */ function amathambo_excerpt_more( $more ) { return '...'; } add_filter( 'excerpt_more', 'amathambo_excerpt_more' ); } if ( ! function_exists( 'amathambo_gutenberg_color_palette' ) ) { /** * Add support for custom color palettes in Gutenberg. */ function amathambo_gutenberg_color_palette() { add_theme_support( 'editor-color-palette', array( array( 'name' => esc_html__( 'White', 'amathambo' ), 'slug' => 'white', 'color' => '#ffffff', ), array( 'name' => esc_html__( 'Lightest Grey', 'amathambo' ), 'slug' => 'lightest-grey', 'color' => '#f5f5f5', ), array( 'name' => esc_html__( 'Lighter Grey', 'amathambo' ), 'slug' => 'lighter-grey', 'color' => '#d1d1d1', ), array( 'name' => esc_html__( 'Light Grey', 'amathambo' ), 'slug' => 'light-grey', 'color' => '#575757', ), array( 'name' => esc_html__( 'Red', 'amathambo' ), 'slug' => 'red', 'color' => '#a30f1e', ), array( 'name' => esc_html__( 'Blue', 'amathambo' ), 'slug' => 'blue', 'color' => '#15587e', ), array( 'name' => esc_html__( 'Black', 'amathambo' ), 'slug' => 'black', 'color' => '#000000', ), ) ); } add_action( 'after_setup_theme', 'amathambo_gutenberg_color_palette' ); } // End if(). if ( ! function_exists( 'amathambo_search_filter' ) ) { if ( ! is_admin() ) { /** * Exclude pages from WordPress search results. * * @param string $query search query. * @return string search results without pages. */ function amathambo_search_filter( $query ) { if ( $query->is_search ) { $query->set( 'post_type', 'post' ); } return $query; } add_filter( 'pre_get_posts','amathambo_search_filter' ); } } if ( ! function_exists( 'amathambo_comment_args' ) ) { /** * Sets arguments for comments * Sets comment policy, the reply title on the comment form as well as sets the textarea to required. */ function amathambo_comment_args() { $commenter = wp_get_current_commenter(); $req = get_option( 'require_name_email' ); $aria_req = ( $req ? " aria-required='true'" : '' ); $fields = array( 'author' => '
', 'email' => ' ' . ( $req ? '*' : '' ) .
'