', esc_url( get_bloginfo( 'pingback_url' ) ) ); } } add_action( 'wp_head', 'ofsupxxp_pingback_header' ); /** * Changes comment form default fields. * * @param array $defaults The default comment form arguments. * * @return array Returns the modified fields. */ function ofsupxxp_comment_form_defaults( $defaults ) { $comment_field = $defaults['comment_field']; // Adjust height of comment form. $defaults['comment_field'] = preg_replace( '/rows="\d+"/', 'rows="5"', $comment_field ); return $defaults; } add_filter( 'comment_form_defaults', 'ofsupxxp_comment_form_defaults' ); /** * Filters the default archive titles. */ function ofsupxxp_get_the_archive_title() { if ( is_category() ) { $title = __( 'Category Archives: ', 'ofisuport' ) . '' . single_term_title( '', false ) . ''; } elseif ( is_tag() ) { $title = __( 'Tag Archives: ', 'ofisuport' ) . '' . single_term_title( '', false ) . ''; } elseif ( is_author() ) { $title = __( 'Author Archives: ', 'ofisuport' ) . '' . get_the_author_meta( 'display_name' ) . ''; } elseif ( is_year() ) { $title = __( 'Yearly Archives: ', 'ofisuport' ) . '' . get_the_date( _x( 'Y', 'yearly archives date format', 'ofisuport' ) ) . ''; } elseif ( is_month() ) { $title = __( 'Monthly Archives: ', 'ofisuport' ) . '' . get_the_date( _x( 'F Y', 'monthly archives date format', 'ofisuport' ) ) . ''; } elseif ( is_day() ) { $title = __( 'Daily Archives: ', 'ofisuport' ) . '' . get_the_date() . ''; } elseif ( is_post_type_archive() ) { $cpt = get_post_type_object( get_queried_object()->name ); $title = sprintf( /* translators: %s: Post type singular name */ esc_html__( '%s Archives', 'ofisuport' ), $cpt->labels->singular_name ); } elseif ( is_tax() ) { $tax = get_taxonomy( get_queried_object()->taxonomy ); $title = sprintf( /* translators: %s: Taxonomy singular name */ esc_html__( '%s Archives', 'ofisuport' ), $tax->labels->singular_name ); } else { $title = __( 'Archives:', 'ofisuport' ); } return $title; } add_filter( 'get_the_archive_title', 'ofsupxxp_get_the_archive_title' ); /** * Determines if post thumbnail can be displayed. */ function ofsupxxp_can_show_post_thumbnail() { return apply_filters( 'ofsupxxp_can_show_post_thumbnail', ! post_password_required() && ! is_attachment() && has_post_thumbnail() ); } /** * Returns the size for avatars used in the theme. */ function ofsupxxp_get_avatar_size() { return 60; } /** * Create the continue reading link */ function ofsupxxp_continue_reading_link() { if ( ! is_admin() ) { $continue_reading = sprintf( /* translators: %s: Name of current post. */ wp_kses( __( 'Continue reading %s', 'ofisuport' ), array( 'span' => array( 'class' => array() ) ) ), the_title( '"', '"', false ) ); return '' . $continue_reading . ''; } } // Filter the excerpt more link. add_filter( 'excerpt_more', 'ofsupxxp_continue_reading_link' ); // Filter the content more link. add_filter( 'the_content_more_link', 'ofsupxxp_continue_reading_link' ); /** * Outputs a comment in the HTML5 format. * * This function overrides the default WordPress comment output in HTML5 format, * adding the required class for Tailwind Typography. Based on the * `html5_comment()` function from WordPress core. * * @param WP_Comment $comment Comment to display. * @param array $args An array of arguments. * @param int $depth Depth of the current comment. */ function ofsupxxp_html5_comment( $comment, $args, $depth ) { $tag = ( 'div' === $args['style'] ) ? 'div' : 'li'; $commenter = wp_get_current_commenter(); $show_pending_links = ! empty( $commenter['comment_author'] ); if ( $commenter['comment_author_email'] ) { $moderation_note = __( 'Your comment is awaiting moderation.', 'ofisuport' ); } else { $moderation_note = __( 'Your comment is awaiting moderation. This is a preview; your comment will be visible after it has been approved.', 'ofisuport' ); } ?> < id="comment-" has_children ? 'parent' : '', $comment ); ?>>
comment_approved || $show_pending_links ) { comment_reply_link( array_merge( $args, array( 'add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => '
', 'after' => '
', ) ) ); } ?>