'; // WPCS: XSS OK.
}
endif;
if ( ! function_exists( 'kepler_theme_post_grid_title' ) ) :
/**
* Prints HTML Title for Grid.
*/
function kepler_theme_post_grid_title($extraClass = null, $show_all_text) {
echo '
@'.esc_html(get_the_author_meta('nickname')).' This is a sample bio. You can change it from WordPress Dashboard, Users → Biographical Info.
Biographical Info
'; // WPCS: XSS OK.
}
endif;
if ( ! function_exists( 'kepler_theme_posted_on' ) ) :
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function kepler_theme_posted_on() {
$time_string = '';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '';
}
$time_string = sprintf( $time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() )
);
$posted_on = sprintf(
esc_html__( 'Posted on %s', 'kepler_theme' ),
'' . $time_string . ''
);
$byline = sprintf(
esc_html__( 'by %s', 'kepler_theme' ),
'' . esc_html( get_the_author() ) . ''
);
echo '' . $posted_on . ' ' . $byline . ''; // WPCS: XSS OK.
}
endif;
if ( ! function_exists( 'kepler_theme_limit_content' ) ) :
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function kepler_theme_limit_content($content) {
// Take the existing content and return a subset of it
return wp_trim_words($content, 40,'...' );
}
endif;
if ( ! function_exists( 'kepler_theme_entry_footer' ) ) :
/**
* Prints HTML with meta information for the categories, tags and comments.
*/
function kepler_theme_entry_footer() {
// Hide category and tag text for pages.
echo '
';
if ( 'post' === get_post_type() ) {
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( esc_html__( ',', 'kepler_theme' ) );
if ( $categories_list && kepler_theme_categorized_blog() ) {
printf( '' . esc_html__( 'Posted in %1$s', 'kepler_theme' ) . '', $categories_list ); // WPCS: XSS OK.
}
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', esc_html__( ' ', 'kepler_theme' ) );
if ( $tags_list ) {
printf( '' . esc_html__( '%1$s', 'kepler_theme' ) . '', $tags_list ); // WPCS: XSS OK.
}
}
if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
echo '';
/* translators: %s: post title */
comments_popup_link( sprintf( wp_kses( __( 'Leave a Comment on %s', 'kepler_theme' ), array( 'span' => array( 'class' => array() ) ) ), get_the_title() ) );
echo '';
}
echo '
';
}
endif;
if ( ! function_exists( 'kepler_theme_post_navigation' ) ) :
/**
* Custom HTML to Print Post Navigation
* @link https://codex.wordpress.org/Next_and_Previous_Links
*/
function kepler_theme_post_navigation() {
echo '
';
/* next link: wrap with div */
next_post_link('%link','Next',true);
/* previous link: wrap with div */
previous_post_link( '%link','Previous',true );
echo '
';
}
endif;
if ( ! function_exists( 'kepler_theme_tags' ) ) :
/**
* Prints HTML post tags
*/
function kepler_theme_tags() {
// Hide category and tag text for pages.
echo '
';
if ( 'post' === get_post_type() ) {
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', esc_html__(' ', 'kepler_theme' ) );
if ( $tags_list ) {
printf( '' . esc_html__( '%1$s', 'kepler_theme' ) . '', $tags_list ); // WPCS: XSS OK.
}
}
echo '
';
}
endif;
if ( ! function_exists( 'kepler_theme_post_social_share' ) ) :
/**
* Display social media links
*/
function kepler_theme_post_social_share() {
// Hide category and tag text for pages.
if ( 'post' === get_post_type() ) {
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( esc_html__( ', ', 'kepler_theme' ) );
if ( $categories_list && kepler_theme_categorized_blog() ) {
printf( '' . esc_html__( 'Posted in %1$s', 'kepler_theme' ) . '', $categories_list ); // WPCS: XSS OK.
}
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', esc_html__( ' ', 'kepler_theme' ) );
if ( $tags_list ) {
printf( '' . esc_html__( '%1$s', 'kepler_theme' ) . '', $tags_list ); // WPCS: XSS OK.
}
}
}
endif;
if ( ! function_exists( 'kepler_theme_comment_form' ) ) :
/**
* Prints Comments Forms with User Avatar.
*/
function kepler_theme_comment_form() {
/* Logged in user */
$user_identity = $aria_req = $commenter = $req = "";
if ( is_user_logged_in() ) {
$current_user = wp_get_current_user();
// If Logout button needed :
$avatar = '
'
);
$cancelIcon = kepler_theme_get_icon('kp_icon_close');
comment_form(
array(
'title_reply' => '',
'cancel_reply_link' => $cancelIcon,
'comment_notes_after' => '',
'comment_notes_before' => '',
'logged_in_as' => '',
'class_submit' => 'btn',
'fields' => apply_filters('comment_form_default_fields', $customFields),
'comment_field' => $avatar,
)
);
}
endif;
/**
* Returns true if a blog has more than 1 category.
*
* @return bool
*/
function kepler_theme_categorized_blog() {
if ( false === ( $all_the_cool_cats = get_transient( 'kepler_theme_categories' ) ) ) {
// Create an array of all the categories that are attached to posts.
$all_the_cool_cats = get_categories( array(
'fields' => 'ids',
'hide_empty' => 1,
// We only need to know if there is more than one category.
'number' => 2,
) );
// Count the number of categories that are attached to the posts.
$all_the_cool_cats = count( $all_the_cool_cats );
set_transient( 'kepler_theme_categories', $all_the_cool_cats );
}
if ( $all_the_cool_cats > 1 ) {
// This blog has more than 1 category so kepler_theme_categorized_blog should return true.
return true;
} else {
// This blog has only 1 category so kepler_theme_categorized_blog should return false.
return false;
}
}
if( ! function_exists( 'kepler_theme_comment_block' ) ):
function kepler_theme_comment_block($comment, $args, $depth) {
?>
';
return $html;
}
/**
* Breadcrumbs for kepler_theme
*/
function kepler_theme_breadcrumb()
{
$showOnHome = 0; // 1 - show breadcrumbs on the homepage, 0 - don't show
$delimiter = kepler_theme_get_icon("kp_icon_chevron_right"); // delimiter between crumbs
$home = 'Home'; // text for the 'Home' link
$showCurrent = 1; // 1 - show current post/page title in breadcrumbs, 0 - don't show
$before = ''; // tag before the current crumb
$after = ''; // tag after the current crumb
$allowed_html = array (
'span' => array (
'class' => array(),
),
'a' => array (
'href' => array(),
'class' => array(),
),
);
global $post;
$homeLink = home_url();
if (is_home() || is_front_page()) {
if ($showOnHome == 1) {
echo '