/**
* Custom template tags for this theme
*
* Eventually, some of the functionality here could be replaced by core features.
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since Twenty Seventeen 1.0
*/
if ( ! function_exists( 'twentyseventeen_posted_on' ) ) :
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function twentyseventeen_posted_on() {
// Get the author name; wrap it in a link.
$byline = sprintf(
/* translators: %s: Post author. */
__( 'by %s', 'twentyseventeen' ),
'' . twentyseventeen_time_link() . ' ';
}
endif;
if ( ! function_exists( 'twentyseventeen_time_link' ) ) :
/**
* Gets a nicely formatted string for the published date.
*/
function twentyseventeen_time_link() {
$time_string = '';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '';
}
$time_string = sprintf(
$time_string,
get_the_date( DATE_W3C ),
get_the_date(),
get_the_modified_date( DATE_W3C ),
get_the_modified_date()
);
// Wrap the time string in a link, and preface it with 'Posted on'.
return sprintf(
/* translators: %s: Post date. */
__( 'Posted on %s', 'twentyseventeen' ),
'' . $time_string . ''
);
}
endif;
if ( ! function_exists( 'twentyseventeen_entry_footer' ) ) :
/**
* Prints HTML with meta information for the categories, tags and comments.
*/
function twentyseventeen_entry_footer() {
$separate_meta = wp_get_list_item_separator();
// Get Categories for posts.
$categories_list = get_the_category_list( $separate_meta );
// Get Tags for posts.
$tags_list = get_the_tag_list( '', $separate_meta );
// We don't want to output .entry-footer if it will be empty, so make sure its not.
if ( ( ( twentyseventeen_categorized_blog() && $categories_list ) || $tags_list ) || get_edit_post_link() ) {
echo ' ';
}
}
endif;
if ( ! function_exists( 'twentyseventeen_edit_link' ) ) :
/**
* Returns an accessibility-friendly link to edit a post or page.
*
* This also gives us a little context about what exactly we're editing
* (post or page?) so that users understand a bit more where they are in terms
* of the template hierarchy and their content. Helpful when/if the single-page
* layout with multiple posts/pages shown gets confusing.
*/
function twentyseventeen_edit_link() {
edit_post_link(
sprintf(
/* translators: %s: Post title. Only visible to screen readers. */
__( 'Edit "%s"', 'twentyseventeen' ),
get_the_title()
),
'',
''
);
}
endif;
/**
* Display a front page section.
*
* @param WP_Customize_Partial $partial Partial associated with a selective refresh request.
* @param int $id Front page section to display.
*/
function twentyseventeen_front_page_section( $partial = null, $id = 0 ) {
if ( is_a( $partial, 'WP_Customize_Partial' ) ) {
// Find out the ID and set it up during a selective refresh.
global $twentyseventeencounter;
$id = str_replace( 'panel_', '', $partial->id );
$twentyseventeencounter = $id;
}
global $post; // Modify the global post object before setting up post data.
if ( get_theme_mod( 'panel_' . $id ) ) {
$post = get_post( get_theme_mod( 'panel_' . $id ) );
setup_postdata( $post );
set_query_var( 'panel', $id );
get_template_part( 'template-parts/page/content', 'front-page-panels' );
wp_reset_postdata();
} elseif ( is_customize_preview() ) {
// The output placeholder anchor.
printf(
'
ВІННИЦЬКИЙ КООПЕРАТИВНИЙ ІНСТИТУТ
КОЛЕДЖ ЕКОНОМІКИ І ПРАВА