%2$s'; $time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()) ); $posted_on = sprintf( '%s', '' . $time_string . '' ); echo ' ' . $posted_on . ''; // WPCS: XSS OK. } elseif ('updated-date' == $element) { $time_string = ''; if (get_the_time('U') !== get_the_modified_time('U')) { $time_string = ''; } $time_string = sprintf($time_string, esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()) ); $posted_on = sprintf( '%s', '' . $time_string . '' ); echo ' ' . $posted_on . ''; // WPCS: XSS OK. } elseif ('author' == $element) { printf( '%s', '' . esc_html(get_the_author()) . '' ); } elseif ('categories' == $element) { $categories_list = get_the_category_list(esc_html__(', ', 'cosmoswp')); if ($categories_list) { printf(' %1$s', $categories_list); // WPCS: XSS OK. } } elseif ('tags' == $element) { /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list('', esc_html__(', ', 'cosmoswp')); if ($tags_list) { printf('%1$s', $tags_list); // WPCS: XSS OK. } } elseif ('comments' == $element) { if (!post_password_required() && (comments_open() || get_comments_number())) { echo ''; comments_popup_link(esc_html__('Leave a comment', 'cosmoswp'), esc_html__('1 Comment', 'cosmoswp'), esc_html__('% Comments', 'cosmoswp')); echo ''; } } else { echo ''; } } if (get_edit_post_link()) : edit_post_link( sprintf( /* translators: %s: Name of current post */ esc_html__('Edit %s', 'cosmoswp'), the_title('"', '"', false) ), '', '' ); endif; } endif; if (!function_exists('cosmoswp_sidebar_template')) { /** * Sidebar Template * Content, Primary and Secondary Sidebar Display Template * @since CosmosWP 1.0.2 * * @param string $sidebar * @param string blog/page/post * @return void * */ function cosmoswp_sidebar_template( $sidebar, $front = 'blog' ) { $primary = "template-parts/sidebar/primary-sidebar"; $secondary = "template-parts/sidebar/secondary-sidebar"; $content = "template-parts/main-content/blog-main-content"; if( 'post' === $front ){ $content = "template-parts/main-content/post-main-content"; } elseif( 'page' === $front ){ $content = "template-parts/main-content/page-main-content"; } elseif( 'cwp-woo-archive' === $front ){ $content = "cwp-woo/cwp-woo-archive-main-content"; $primary = "cwp-woo/cwp-woo-primary-sidebar"; $secondary = "cwp-woo/cwp-woo-secondary-sidebar"; } elseif( 'cwp-woo-single' === $front ){ $content = "cwp-woo/cwp-woo-single-main-content"; $primary = "cwp-woo/cwp-woo-primary-sidebar"; $secondary = "cwp-woo/cwp-woo-secondary-sidebar"; } elseif( 'cwp-edd-archive' === $front ){ $content = "edd/edd-archive-main-content"; $primary = "edd/edd-primary-sidebar"; $secondary = "edd/edd-secondary-sidebar"; } elseif( 'cwp-edd-single' === $front ){ $content = "edd/edd-single-main-content"; $primary = "edd/edd-primary-sidebar"; $secondary = "edd/edd-secondary-sidebar"; } switch ($sidebar): case 'ful-ct': echo '
'; get_template_part($content); echo '
'; break; case 'middle-ct': echo '
'; get_template_part($content); echo '
'; break; case 'ps-ct': echo '
'; get_template_part($primary); echo '
'; echo '
'; get_template_part($content); echo '
'; break; case 'ct-ps': echo '
'; get_template_part($content); echo '
'; echo '
'; get_template_part($primary); echo '
'; break; case 'ss-ct-ps': echo '
'; get_template_part($secondary); echo '
'; echo '
'; get_template_part($content); echo '
'; echo '
'; get_template_part($primary); echo '
'; break; case 'ss-ps-ct': echo '
'; get_template_part($secondary); echo '
'; echo '
'; get_template_part($primary); echo '
'; echo '
'; get_template_part($content); echo '
'; break; case 'ct-ps-ss': echo '
'; get_template_part($content); echo '
'; echo '
'; get_template_part($secondary); echo '
'; echo '
'; get_template_part($primary); echo '
'; break; default: echo '
'; get_template_part($content); echo '
'; break; endswitch; } }