', esc_url( get_bloginfo( 'pingback_url' ) ) ); } } add_action( 'wp_head', 'astroride_pingback_header' ); /** * Adds custom class to the array of posts classes. */ function astroride_post_classes( $classes, $class, $post_id ) { $classes[] = 'entry'; return $classes; } add_filter( 'post_class', 'astroride_post_classes', 10, 3 ); /** * Customize tag cloud widget */ function astroride_customize_tag_cloud( $args ) { $args['largest'] = 13; $args['smallest'] = 13; $args['unit'] = 'px'; $args['number'] = 20; return $args; } add_filter( 'widget_tag_cloud_args', 'astroride_customize_tag_cloud' ); /** * Change the excerpt more string. */ function astroride_excerpt_more( $more ) { return '…'; } add_filter( 'excerpt_more', 'astroride_excerpt_more' ); /** * Limit excerpt length */ function astroride_excerpt_length( $length ) { return 40; } add_filter( 'excerpt_length', 'astroride_excerpt_length', 999 ); /** * Returns true if comment is by author of the post. * * @see get_comment_class() */ function astroride_is_comment_by_post_author( $comment = null ) { if ( is_object( $comment ) && $comment->user_id > 0 ) { $user = get_userdata( $comment->user_id ); $post = get_post( $comment->comment_post_ID ); if ( ! empty( $user ) && ! empty( $post ) ) { return $comment->user_id === $post->post_author; } } return false; } /** * Add a dropdown icon to top-level menu items. */ function astroride_add_dropdown_icons( $output, $item, $depth, $args ) { // Only add class to 'top level' items on the 'primary' menu. if ( 'mobile' !== $args->theme_location ) { return $output; } if ( in_array( 'menu-item-has-children', $item->classes, true ) ) { // Add SVG icon to parent items. $icon = astroride_get_icon_svg( 'keyboard_arrow_down' ); $output .= sprintf( '', $icon ); } return $output; } add_filter( 'walker_nav_menu_start_el', 'astroride_add_dropdown_icons', 10, 4 );