|
@@ -3,15 +3,15 @@
|
|
|
* Custom template tags for this theme
|
|
|
*
|
|
|
* @package WordPress
|
|
|
- * @subpackage _Dsgnsystm
|
|
|
+ * @subpackage Varia
|
|
|
* @since 1.0.0
|
|
|
*/
|
|
|
|
|
|
-if ( ! function_exists( '_dsgnsystm_posted_on' ) ) :
|
|
|
+if ( ! function_exists( 'varia_posted_on' ) ) :
|
|
|
/**
|
|
|
* Prints HTML with meta information for the current post-date/time.
|
|
|
*/
|
|
|
- function _dsgnsystm_posted_on() {
|
|
|
+ function varia_posted_on() {
|
|
|
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
|
|
|
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
|
|
|
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
|
|
@@ -27,81 +27,81 @@ if ( ! function_exists( '_dsgnsystm_posted_on' ) ) :
|
|
|
|
|
|
printf(
|
|
|
'<span class="posted-on">%1$s<a href="%2$s" rel="bookmark">%3$s</a></span>',
|
|
|
- _dsgnsystm_get_icon_svg( 'watch', 16 ),
|
|
|
+ varia_get_icon_svg( 'watch', 16 ),
|
|
|
esc_url( get_permalink() ),
|
|
|
$time_string
|
|
|
);
|
|
|
}
|
|
|
endif;
|
|
|
|
|
|
-if ( ! function_exists( '_dsgnsystm_posted_by' ) ) :
|
|
|
+if ( ! function_exists( 'varia_posted_by' ) ) :
|
|
|
/**
|
|
|
* Prints HTML with meta information about theme author.
|
|
|
*/
|
|
|
- function _dsgnsystm_posted_by() {
|
|
|
+ function varia_posted_by() {
|
|
|
printf(
|
|
|
/* translators: 1: SVG icon. 2: post author, only visible to screen readers. 3: author link. */
|
|
|
'<span class="byline">%1$s<span class="screen-reader-text">%2$s</span><span class="author vcard"><a class="url fn n" href="%3$s">%4$s</a></span></span>',
|
|
|
- _dsgnsystm_get_icon_svg( 'person', 16 ),
|
|
|
- __( 'Posted by', '_dsgnsystm' ),
|
|
|
+ varia_get_icon_svg( 'person', 16 ),
|
|
|
+ __( 'Posted by', 'varia' ),
|
|
|
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
|
|
|
esc_html( get_the_author() )
|
|
|
);
|
|
|
}
|
|
|
endif;
|
|
|
|
|
|
-if ( ! function_exists( '_dsgnsystm_comment_count' ) ) :
|
|
|
+if ( ! function_exists( 'varia_comment_count' ) ) :
|
|
|
/**
|
|
|
* Prints HTML with the comment count for the current post.
|
|
|
*/
|
|
|
- function _dsgnsystm_comment_count() {
|
|
|
+ function varia_comment_count() {
|
|
|
if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
|
|
|
echo '<span class="comments-link">';
|
|
|
- echo _dsgnsystm_get_icon_svg( 'comment', 16 );
|
|
|
+ echo varia_get_icon_svg( 'comment', 16 );
|
|
|
|
|
|
/* translators: %s: Name of current post. Only visible to screen readers. */
|
|
|
- comments_popup_link( sprintf( __( 'Leave a comment<span class="screen-reader-text"> on %s</span>', '_dsgnsystm' ), get_the_title() ) );
|
|
|
+ comments_popup_link( sprintf( __( 'Leave a comment<span class="screen-reader-text"> on %s</span>', 'varia' ), get_the_title() ) );
|
|
|
|
|
|
echo '</span>';
|
|
|
}
|
|
|
}
|
|
|
endif;
|
|
|
|
|
|
-if ( ! function_exists( '_dsgnsystm_entry_meta' ) ) :
|
|
|
+if ( ! function_exists( 'varia_entry_meta' ) ) :
|
|
|
/**
|
|
|
* Prints HTML with meta information for the categories, tags and comments.
|
|
|
*/
|
|
|
- function _dsgnsystm_entry_meta() {
|
|
|
+ function varia_entry_meta() {
|
|
|
|
|
|
// Hide author, post date, category and tag text for pages.
|
|
|
if ( 'post' === get_post_type() ) {
|
|
|
|
|
|
// Posted by
|
|
|
- _dsgnsystm_posted_by();
|
|
|
+ varia_posted_by();
|
|
|
|
|
|
// Posted on
|
|
|
- _dsgnsystm_posted_on();
|
|
|
+ varia_posted_on();
|
|
|
|
|
|
/* translators: used between list items, there is a space after the comma. */
|
|
|
- $categories_list = get_the_category_list( __( ', ', '_dsgnsystm' ) );
|
|
|
+ $categories_list = get_the_category_list( __( ', ', 'varia' ) );
|
|
|
if ( $categories_list ) {
|
|
|
printf(
|
|
|
/* translators: 1: SVG icon. 2: posted in label, only visible to screen readers. 3: list of categories. */
|
|
|
'<span class="cat-links">%1$s<span class="screen-reader-text">%2$s</span>%3$s</span>',
|
|
|
- _dsgnsystm_get_icon_svg( 'archive', 16 ),
|
|
|
- __( 'Posted in', '_dsgnsystm' ),
|
|
|
+ varia_get_icon_svg( 'archive', 16 ),
|
|
|
+ __( 'Posted in', 'varia' ),
|
|
|
$categories_list
|
|
|
); // WPCS: XSS OK.
|
|
|
}
|
|
|
|
|
|
/* translators: used between list items, there is a space after the comma. */
|
|
|
- $tags_list = get_the_tag_list( '', __( ', ', '_dsgnsystm' ) );
|
|
|
+ $tags_list = get_the_tag_list( '', __( ', ', 'varia' ) );
|
|
|
if ( $tags_list ) {
|
|
|
printf(
|
|
|
/* translators: 1: SVG icon. 2: posted in label, only visible to screen readers. 3: list of tags. */
|
|
|
'<span class="tags-links">%1$s<span class="screen-reader-text">%2$s</span>%3$s</span>',
|
|
|
- _dsgnsystm_get_icon_svg( 'tag', 16 ),
|
|
|
- __( 'Tags:', '_dsgnsystm' ),
|
|
|
+ varia_get_icon_svg( 'tag', 16 ),
|
|
|
+ __( 'Tags:', 'varia' ),
|
|
|
$tags_list
|
|
|
); // WPCS: XSS OK.
|
|
|
}
|
|
@@ -109,7 +109,7 @@ if ( ! function_exists( '_dsgnsystm_entry_meta' ) ) :
|
|
|
|
|
|
// Comment count.
|
|
|
if ( ! is_singular() ) {
|
|
|
- _dsgnsystm_comment_count();
|
|
|
+ varia_comment_count();
|
|
|
}
|
|
|
|
|
|
// Edit post link.
|
|
@@ -117,7 +117,7 @@ if ( ! function_exists( '_dsgnsystm_entry_meta' ) ) :
|
|
|
sprintf(
|
|
|
wp_kses(
|
|
|
/* translators: %s: Name of current post. Only visible to screen readers. */
|
|
|
- __( 'Edit <span class="screen-reader-text">%s</span>', '_dsgnsystm' ),
|
|
|
+ __( 'Edit <span class="screen-reader-text">%s</span>', 'varia' ),
|
|
|
array(
|
|
|
'span' => array(
|
|
|
'class' => array(),
|
|
@@ -126,47 +126,47 @@ if ( ! function_exists( '_dsgnsystm_entry_meta' ) ) :
|
|
|
),
|
|
|
get_the_title()
|
|
|
),
|
|
|
- '<span class="edit-link">' . _dsgnsystm_get_icon_svg( 'edit', 16 ),
|
|
|
+ '<span class="edit-link">' . varia_get_icon_svg( 'edit', 16 ),
|
|
|
'</span>'
|
|
|
);
|
|
|
}
|
|
|
endif;
|
|
|
|
|
|
-if ( ! function_exists( '_dsgnsystm_entry_footer' ) ) :
|
|
|
+if ( ! function_exists( 'varia_entry_footer' ) ) :
|
|
|
/**
|
|
|
* Prints HTML with meta information for the categories, tags and comments.
|
|
|
*/
|
|
|
- function _dsgnsystm_entry_footer() {
|
|
|
+ function varia_entry_footer() {
|
|
|
|
|
|
// Hide author, post date, category and tag text for pages.
|
|
|
if ( 'post' === get_post_type() ) {
|
|
|
|
|
|
// Posted by
|
|
|
- _dsgnsystm_posted_by();
|
|
|
+ varia_posted_by();
|
|
|
|
|
|
// Posted on
|
|
|
- _dsgnsystm_posted_on();
|
|
|
+ varia_posted_on();
|
|
|
|
|
|
/* translators: used between list items, there is a space after the comma. */
|
|
|
- $categories_list = get_the_category_list( __( ', ', '_dsgnsystm' ) );
|
|
|
+ $categories_list = get_the_category_list( __( ', ', 'varia' ) );
|
|
|
if ( $categories_list ) {
|
|
|
printf(
|
|
|
/* translators: 1: SVG icon. 2: posted in label, only visible to screen readers. 3: list of categories. */
|
|
|
'<span class="cat-links">%1$s<span class="screen-reader-text">%2$s</span>%3$s</span>',
|
|
|
- _dsgnsystm_get_icon_svg( 'archive', 16 ),
|
|
|
- __( 'Posted in', '_dsgnsystm' ),
|
|
|
+ varia_get_icon_svg( 'archive', 16 ),
|
|
|
+ __( 'Posted in', 'varia' ),
|
|
|
$categories_list
|
|
|
); // WPCS: XSS OK.
|
|
|
}
|
|
|
|
|
|
/* translators: used between list items, there is a space after the comma. */
|
|
|
- $tags_list = get_the_tag_list( '', __( ', ', '_dsgnsystm' ) );
|
|
|
+ $tags_list = get_the_tag_list( '', __( ', ', 'varia' ) );
|
|
|
if ( $tags_list ) {
|
|
|
printf(
|
|
|
/* translators: 1: SVG icon. 2: posted in label, only visible to screen readers. 3: list of tags. */
|
|
|
'<span class="tags-links">%1$s<span class="screen-reader-text">%2$s</span>%3$s</span>',
|
|
|
- _dsgnsystm_get_icon_svg( 'tag', 16 ),
|
|
|
- __( 'Tags:', '_dsgnsystm' ),
|
|
|
+ varia_get_icon_svg( 'tag', 16 ),
|
|
|
+ __( 'Tags:', 'varia' ),
|
|
|
$tags_list
|
|
|
); // WPCS: XSS OK.
|
|
|
}
|
|
@@ -174,7 +174,7 @@ if ( ! function_exists( '_dsgnsystm_entry_footer' ) ) :
|
|
|
|
|
|
// Comment count.
|
|
|
if ( ! is_singular() ) {
|
|
|
- _dsgnsystm_comment_count();
|
|
|
+ varia_comment_count();
|
|
|
}
|
|
|
|
|
|
// Edit post link.
|
|
@@ -182,7 +182,7 @@ if ( ! function_exists( '_dsgnsystm_entry_footer' ) ) :
|
|
|
sprintf(
|
|
|
wp_kses(
|
|
|
/* translators: %s: Name of current post. Only visible to screen readers. */
|
|
|
- __( 'Edit <span class="screen-reader-text">%s</span>', '_dsgnsystm' ),
|
|
|
+ __( 'Edit <span class="screen-reader-text">%s</span>', 'varia' ),
|
|
|
array(
|
|
|
'span' => array(
|
|
|
'class' => array(),
|
|
@@ -191,21 +191,21 @@ if ( ! function_exists( '_dsgnsystm_entry_footer' ) ) :
|
|
|
),
|
|
|
get_the_title()
|
|
|
),
|
|
|
- '<span class="edit-link">' . _dsgnsystm_get_icon_svg( 'edit', 16 ),
|
|
|
+ '<span class="edit-link">' . varia_get_icon_svg( 'edit', 16 ),
|
|
|
'</span>'
|
|
|
);
|
|
|
}
|
|
|
endif;
|
|
|
|
|
|
-if ( ! function_exists( '_dsgnsystm_post_thumbnail' ) ) :
|
|
|
+if ( ! function_exists( 'varia_post_thumbnail' ) ) :
|
|
|
/**
|
|
|
* Displays an optional post thumbnail.
|
|
|
*
|
|
|
* Wraps the post thumbnail in an anchor element on index views, or a div
|
|
|
* element when on single views.
|
|
|
*/
|
|
|
- function _dsgnsystm_post_thumbnail() {
|
|
|
- if ( ! _dsgnsystm_can_show_post_thumbnail() ) {
|
|
|
+ function varia_post_thumbnail() {
|
|
|
+ if ( ! varia_can_show_post_thumbnail() ) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -231,25 +231,25 @@ if ( ! function_exists( '_dsgnsystm_post_thumbnail' ) ) :
|
|
|
}
|
|
|
endif;
|
|
|
|
|
|
-if ( ! function_exists( '_dsgnsystm_comment_avatar' ) ) :
|
|
|
+if ( ! function_exists( 'varia_comment_avatar' ) ) :
|
|
|
/**
|
|
|
* Returns the HTML markup to generate a user avatar.
|
|
|
*/
|
|
|
- function _dsgnsystm_get_user_avatar_markup( $id_or_email = null ) {
|
|
|
+ function varia_get_user_avatar_markup( $id_or_email = null ) {
|
|
|
|
|
|
if ( ! isset( $id_or_email ) ) {
|
|
|
$id_or_email = get_current_user_id();
|
|
|
}
|
|
|
|
|
|
- return sprintf( '<div class="comment-user-avatar comment-author vcard">%s</div>', get_avatar( $id_or_email, _dsgnsystm_get_avatar_size() ) );
|
|
|
+ return sprintf( '<div class="comment-user-avatar comment-author vcard">%s</div>', get_avatar( $id_or_email, varia_get_avatar_size() ) );
|
|
|
}
|
|
|
endif;
|
|
|
|
|
|
-if ( ! function_exists( '_dsgnsystm_discussion_avatars_list' ) ) :
|
|
|
+if ( ! function_exists( 'varia_discussion_avatars_list' ) ) :
|
|
|
/**
|
|
|
* Displays a list of avatars involved in a discussion for a given post.
|
|
|
*/
|
|
|
- function _dsgnsystm_discussion_avatars_list( $comment_authors ) {
|
|
|
+ function varia_discussion_avatars_list( $comment_authors ) {
|
|
|
if ( empty( $comment_authors ) ) {
|
|
|
return;
|
|
|
}
|
|
@@ -257,18 +257,18 @@ if ( ! function_exists( '_dsgnsystm_discussion_avatars_list' ) ) :
|
|
|
foreach ( $comment_authors as $id_or_email ) {
|
|
|
printf(
|
|
|
"<li>%s</li>\n",
|
|
|
- _dsgnsystm_get_user_avatar_markup( $id_or_email )
|
|
|
+ varia_get_user_avatar_markup( $id_or_email )
|
|
|
);
|
|
|
}
|
|
|
echo '</ol><!-- .discussion-avatar-list -->', "\n";
|
|
|
}
|
|
|
endif;
|
|
|
|
|
|
-if ( ! function_exists( '_dsgnsystm_comment_form' ) ) :
|
|
|
+if ( ! function_exists( 'varia_comment_form' ) ) :
|
|
|
/**
|
|
|
* Documentation for function.
|
|
|
*/
|
|
|
- function _dsgnsystm_comment_form( $order ) {
|
|
|
+ function varia_comment_form( $order ) {
|
|
|
if ( true === $order || strtolower( $order ) === strtolower( get_option( 'comment_order', 'asc' ) ) ) {
|
|
|
|
|
|
comment_form(
|
|
@@ -281,23 +281,23 @@ if ( ! function_exists( '_dsgnsystm_comment_form' ) ) :
|
|
|
}
|
|
|
endif;
|
|
|
|
|
|
-if ( ! function_exists( '_dsgnsystm_the_posts_navigation' ) ) :
|
|
|
+if ( ! function_exists( 'varia_the_posts_navigation' ) ) :
|
|
|
/**
|
|
|
* Documentation for function.
|
|
|
*/
|
|
|
- function _dsgnsystm_the_posts_navigation() {
|
|
|
+ function varia_the_posts_navigation() {
|
|
|
the_posts_pagination(
|
|
|
array(
|
|
|
'mid_size' => 2,
|
|
|
'prev_text' => sprintf(
|
|
|
'%s <span class="nav-prev-text">%s</span>',
|
|
|
- _dsgnsystm_get_icon_svg( 'chevron_left', 22 ),
|
|
|
- __( 'Newer posts', '_dsgnsystm' )
|
|
|
+ varia_get_icon_svg( 'chevron_left', 22 ),
|
|
|
+ __( 'Newer posts', 'varia' )
|
|
|
),
|
|
|
'next_text' => sprintf(
|
|
|
'<span class="nav-next-text">%s</span> %s',
|
|
|
- __( 'Older posts', '_dsgnsystm' ),
|
|
|
- _dsgnsystm_get_icon_svg( 'chevron_right', 22 )
|
|
|
+ __( 'Older posts', 'varia' ),
|
|
|
+ varia_get_icon_svg( 'chevron_right', 22 )
|
|
|
),
|
|
|
)
|
|
|
);
|