', esc_url( get_bloginfo( 'pingback_url' ) ) );
}
}
add_action( 'wp_head', 'wowpress_pingback_header' );
/**
* Changes comment form default fields.
*
* @param array $defaults The default comment form arguments.
*
* @return array Returns the modified fields.
*/
function wowpress_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', 'wowpress_comment_form_defaults' );
/**
* Filters the default archive titles.
*/
function wowpress_get_the_archive_title() {
if ( is_category() ) {
$title = __( 'Category Archives: ', 'wowpress' ) . '' . single_term_title( '', false ) . '';
} elseif ( is_tag() ) {
$title = __( 'Tag Archives: ', 'wowpress' ) . '' . single_term_title( '', false ) . '';
} elseif ( is_author() ) {
$title = __( 'Author Archives: ', 'wowpress' ) . '' . get_the_author_meta( 'display_name' ) . '';
} elseif ( is_year() ) {
$title = __( 'Yearly Archives: ', 'wowpress' ) . '' . get_the_date( _x( 'Y', 'yearly archives date format', 'wowpress' ) ) . '';
} elseif ( is_month() ) {
$title = __( 'Monthly Archives: ', 'wowpress' ) . '' . get_the_date( _x( 'F Y', 'monthly archives date format', 'wowpress' ) ) . '';
} elseif ( is_day() ) {
$title = __( 'Daily Archives: ', 'wowpress' ) . '' . 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', 'wowpress' ),
$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', 'wowpress' ),
$tax->labels->singular_name
);
} else {
$title = __( 'Archives:', 'wowpress' );
}
return $title;
}
add_filter( 'get_the_archive_title', 'wowpress_get_the_archive_title' );
/**
* Determines whether the post thumbnail can be displayed.
*/
function wowpress_can_show_post_thumbnail() {
return apply_filters( 'wowpress_can_show_post_thumbnail', ! post_password_required() && ! is_attachment() && has_post_thumbnail() );
}
/**
* Returns the size for avatars used in the theme.
*/
function wowpress_get_avatar_size() {
return 60;
}
/**
* Create the continue reading link
*
* @param string $more_string The string shown within the more link.
*/
function wowpress_continue_reading_link( $more_string ) {
if ( ! is_admin() ) {
$continue_reading = sprintf(
/* translators: %s: Name of current post. */
wp_kses( __( 'Continue reading %s', 'wowpress' ), array( 'span' => array( 'class' => array() ) ) ),
the_title( '"', '"', false )
);
$more_string = '' . $continue_reading . '';
}
return $more_string;
}
// Filter the excerpt more link.
add_filter( 'excerpt_more', 'wowpress_continue_reading_link' );
// Filter the content more link.
add_filter( 'the_content_more_link', 'wowpress_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 wowpress_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.', 'wowpress' );
} else {
$moderation_note = __( 'Your comment is awaiting moderation. This is a preview; your comment will be visible after it has been approved.', 'wowpress' );
}
?>
< 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' => '
',
)
)
);
}
?>