urlencode( implode( '|', $font_families ) ),
'subset' => urlencode( 'cyrillic,latin-ext' ),
);
$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
}
return esc_url_raw( $fonts_url );
}
}
// Display the logo
if ( ! function_exists( 'bento_logo' ) ) {
function bento_logo() {
echo '
'.$post_date_link.'
'.$post_day.'
'.$post_month.'
'.$post_year.'
'.$post_date_link_close.'
';
}
}
// Display post title
if ( ! function_exists( 'bento_post_title' ) ) {
function bento_post_title() {
global $post;
// Check for formats which do not imply a title
if ( in_array( get_post_format(), array('link','aside','status','quote'), true ) ) {
return;
}
// If project post type and has a sidebar, exit
if ( get_post_type() == 'project' && get_post_meta( $post->ID, 'bento_sidebar_layout', true ) != 'full-width' ) {
return;
}
// If extended post header active, exit
if ( is_singular() && get_post_meta( $post->ID, 'bento_activate_header', true ) == 'on' ) {
return;
}
// If front page and Customizer-set header active, exit
if ( is_front_page() && 'page' == get_option('show_on_front') && get_theme_mod( 'bento_front_header_image' ) != '' ) {
return;
}
echo '';
}
}
// Display post content according to the post format
if ( ! function_exists( 'bento_post_content' ) ) {
function bento_post_content() {
global $post;
// If project post type and has a sidebar, exit
if ( get_post_type() == 'project' && get_post_meta( $post->ID, 'bento_sidebar_layout', true ) != 'full-width' ) {
return;
}
echo '';
// Check for post format and display respective content
if ( get_post_format() === 'link' ) {
if ( bento_link_format_content() != false ) {
echo bento_link_format_content();
} else {
the_content( esc_html__( 'Continue reading', 'bento' ).' →' );
}
} else if ( get_post_format() === 'quote' ) {
echo bento_quote_format_content();
} else {
if ( is_home() && has_excerpt() ) {
the_excerpt();
} else {
the_content( esc_html__( 'Continue reading', 'bento' ).' →' );
}
}
// Navigation for paged posts
wp_link_pages(
array(
'before' => '
',
'after' => '
',
'link_before' => '
',
'link_after' => '',
)
);
echo '
';
}
}
// Display entry meta
if ( ! function_exists( 'bento_entry_meta' ) ) {
function bento_entry_meta() {
echo '';
return;
}
// If project, display navigation
if ( get_post_type() == 'project' && is_singular('project') ) {
if ( function_exists( 'bento_ep_project_nav' ) ) {
bento_ep_project_nav();
}
return;
}
// Display a pin for sticky posts
if ( is_sticky() && is_home() && ! is_paged() ) {
echo ' id="comment-">
comment_approved == '0' ) { ?>
'← '.esc_html__( 'Previous page', 'bento' ),
'next_text' => esc_html__( 'Next page', 'bento' ).' →',
)
);
}
}
// Display a pager for grid pages
if ( ! function_exists( 'bento_grid_pagination' ) ) {
function bento_grid_pagination() {
global $bento_query;
?>
'.esc_html( $anchor ).'';
} else {
return false;
}
}
}
// Display content for the "quote" post type
if ( ! function_exists( 'bento_quote_format_content' ) ) {
function bento_quote_format_content() {
$output = '
'.get_the_content().'
';
$author = esc_html( get_the_title() );
if ( $author != '' ) {
$output .= '
'.$author.'
';
}
return $output;
}
}
// Display the copyright in the footer
if ( ! function_exists( 'bento_copyright' ) ) {
function bento_copyright() {
$sitename = esc_attr( get_bloginfo( 'name' ) );
$author = esc_html__( 'Bento theme by Satori', 'bento' );
if ( is_front_page() ) {
$author = 'Bento ' . esc_html__( 'theme by', 'bento' ) . '
Satori Studio';
}
$copyright = '';
if ( get_option( 'bento_ep_license_status' ) != 'valid' || get_theme_mod( 'bento_footer_copyright' ) != '' ) {
echo wp_kses( $copyright,
array(
'a' => array(
'target' => array(),
'href' => array(),
'title' => array(),
),
'div' => array(
'class' => array(),
),
'span' => array(),
)
);
}
}
}
// Display the button for the ajax loader
if ( ! function_exists( 'bento_ajax_load_more' ) ) {
function bento_ajax_load_more() {
if ( is_home() || is_archive() || is_search() ) {
$class = '';
} else {
$class = 'grid-ajax-load-more';
}
?>
ID ) === 'quote' ) {
$tile_title = '"'.esc_html( get_the_content() ).'"
'.esc_html( get_the_title() ).'';
} else {
$tile_title = esc_html( get_the_title() );
}
if ( get_post_meta( $bento_parent_page_id, 'bento_hide_tile_overlays', true) == 'on' ) {
$tile_content_opacity = 'style="opacity: 0.0"';
}
$tile_types = get_post_meta( $bento_parent_page_id, 'bento_page_content_types', true );
if ( is_array( $tile_types ) ) {
if ( implode( $tile_types ) == 'project' ) {
$types_objects = get_the_terms( $post->ID, 'project_type' );
$tile_project_types_list = array();
if ( $types_objects != false ) {
foreach ( $types_objects as $types_object ) {
$tile_project_types_list[] = esc_html( $types_object->name );
}
$tile_project_types_list = implode(', ', $tile_project_types_list);
$tile_project_types = '
'.$tile_project_types_list.'
';
}
}
}
$tile_text_color = 'color:'.esc_html( get_post_meta( $post->ID, 'bento_tile_text_color', true ) ).';';
$tile_text_size = 'font-size:'.esc_html( get_post_meta( $post->ID, 'bento_tile_text_size', true ) ).'px;';
$tile_text_style .= 'style="'.$tile_text_color.$tile_text_size.'"';
$tile_content .= '
'.$tile_project_types.'
';
// Background
if ( get_post_meta( $post->ID, 'bento_tile_image', true ) != '' ) {
$tile_image = esc_url( get_post_meta( $post->ID, 'bento_tile_image', true ) );
} else if ( has_post_thumbnail() ) {
$post_thumb = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
$tile_image = esc_url( $post_thumb[0] );
}
$tile_background .= 'style=background-image:url("'.$tile_image.'")';
if ( get_post_meta( $post->ID, 'bento_tile_overlay_opacity', true) != '' ) {
if ( get_post_meta( $bento_parent_page_id, 'bento_hide_tile_overlays', true) != 'on' ) {
$tile_opacity_raw = esc_html( get_post_meta( $post->ID, 'bento_tile_overlay_opacity', true) );
if ( $tile_opacity_raw > 1 ) {
$tile_opacity_raw = $tile_opacity_raw / 10;
}
$tile_opacity = 'opacity:'.$tile_opacity_raw.';';
} else {
$tile_opacity = 'opacity: 0.0';
}
}
if ( get_post_meta( $post->ID, 'bento_tile_overlay_color', true ) != '' ) {
$tile_color = 'background-color:'.esc_html( get_post_meta( $post->ID, 'bento_tile_overlay_color', true ) ).';';
}
$tile_overlay .= 'style="'.$tile_color.$tile_opacity.'"';
$tile_content .= '
';
echo $tile_content;
}
}
?>