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 ''; } } // Primary menu if ( ! function_exists( 'bento_primary_menu' ) ) { function bento_primary_menu() { if ( ! has_nav_menu( 'primary-menu' ) ) { return; } $depth = '3'; if ( get_theme_mod( 'bento_menu_config' ) == 2 ) { $depth = '1'; } ?>
'primary-menu', 'echo' => FALSE, 'fallback_cb' => '__return_false' ) ); if ( empty($menu) ) { return; } ?>
'.wp_kses( get_the_title(), array( 'br' => array() ) ).''; } if ( has_excerpt( $postid ) ) { $subtitle = '
'.wp_kses( get_the_excerpt( $postid ), array( 'br' => array() ) ).'
'; } // Set call-to-action elements $cta_front = $cta_primary = $cta_p = $cta_p_old = $cta_p_text = $cta_p_link = $cta_secondary = $cta_s = $cta_s_old = $cta_s_text = $cta_s_link = ''; if ( is_front_page() && 'page' == get_option('show_on_front') ) { $cta_front = 'true'; } if ( get_theme_mod( 'bento_front_header_primary_cta_text' ) != '' && $cta_front == 'true' ) { $cta_p = 'on'; $cta_p_text = get_theme_mod( 'bento_front_header_primary_cta_text' ); $cta_p_link = get_theme_mod( 'bento_front_header_primary_cta_link' ); } else if ( get_post_meta( $postid, 'bento_cta_primary_text', true ) != '' ) { $cta_p = 'on'; $cta_p_old = 'true'; $cta_p_text = get_post_meta( $postid, 'bento_cta_primary_text', true ); $cta_p_link = get_post_meta( $postid, 'bento_cta_primary_link', true ); } if ( get_theme_mod('bento_front_header_secondary_cta_text') != '' && $cta_front == 'true' ) { $cta_s = 'on'; $cta_s_text = get_theme_mod( 'bento_front_header_secondary_cta_text' ); $cta_s_link = get_theme_mod( 'bento_front_header_secondary_cta_link' ); } else if ( get_post_meta( $postid, 'bento_cta_secondary_text', true ) != '' ) { $cta_s = 'on'; $cta_s_old = 'true'; $cta_s_text = get_post_meta( $postid, 'bento_cta_secondary_text', true ); $cta_s_link = get_post_meta( $postid, 'bento_cta_secondary_link', true ); } if ( $cta_p == 'on' ) { if ( $cta_p_link != '' ) { $cta_primary = ' '.esc_html( $cta_p_text ).' '; } else { $cta_primary = '
'.esc_html( $cta_p_text ).'
'; } } if ( $cta_s == 'on' ) { if ( $cta_s_link != '' ) { $cta_secondary = ' '.esc_html( $cta_s_text ).' '; } else { $cta_secondary = '
'.esc_html( $cta_s_text ).'
'; } } if ( $cta_primary != '' || $cta_secondary != '' ) { $cta = '
'.$cta_primary.' '.$cta_secondary.'
'; } // Set video if defined and if EP is activated if ( get_post_meta( $postid, 'bento_header_video_source', true ) != '' && get_option( 'bento_ep_license_status' ) == 'valid' && function_exists('bento_ep_video_header') ) { $video_header = bento_ep_video_header(); } // Set Google Maps if defined and if EP is activated if ( get_post_meta( $postid, 'bento_activate_headermap', true ) == 'on' && get_option( 'bento_ep_license_status' ) == 'valid' ) { echo '
'; return; } // Render the markup if ( ( get_post_meta( $postid, 'bento_activate_header', true ) == 'on' && get_post_meta( $postid, 'bento_activate_headermap', true ) != 'on' ) || ( is_front_page() && 'page' == get_option('show_on_front') && get_theme_mod( 'bento_front_header_image' ) != '' ) ) { echo '
'.$video_header.'
'.$title.' '.$subtitle.' '.$cta.'
'; } } } // Display an optional post thumbnail. if ( ! function_exists( 'bento_post_thumbnail' ) ) { function bento_post_thumbnail() { global $post; global $bento_parent_page_id; // Check if it's one of the situations when a thumbnail is not needed, and exit if yes if ( ! has_post_thumbnail() || post_password_required() || is_attachment() || get_post_format( $post->ID ) === 'quote' || ( is_singular( array( 'post' , 'project' ) ) && get_post_meta( $post->ID, 'bento_hide_thumb', true ) == 'on' ) || ( is_singular( 'post', 'project', 'product' ) && get_post_meta( $post->ID, 'bento_activate_header', true ) == 'on' ) ) { return; } if ( is_singular() && get_page_template_slug( $bento_parent_page_id ) != 'grid.php' ) { ?>
get_the_title() ) ); ?>
'; $post_date_link_close = ''; } else { $post_date_link = $post_date_link_close = ''; } $post_day = esc_html( get_the_date('d') ); $post_month = esc_html( get_the_date('M') ); $post_year = esc_html( get_the_date('Y') ); 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 '
'; // Main title if ( is_singular() ) { if ( get_post_meta( $post->ID, 'bento_hide_title', true) != 'on' ) { the_title( '

', '

' ); } } else { the_title( sprintf( '

', esc_url( get_permalink() ) ), '

' ); } // Subtitle if ( is_singular() && has_excerpt( $post->ID ) ) { echo '
'.esc_html( get_the_excerpt( $post->ID ) ).'
'; } 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' ) { $quote = esc_html( get_the_content() ); echo '
'; the_content( esc_html__( 'Continue reading', 'bento' ).' →' ); echo '
'.esc_html( get_the_title() ).'
'; } else { the_content( esc_html__( 'Continue reading', 'bento' ).' →' ); } // Navigation for paged posts wp_link_pages( array( 'before' => '', '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 ''; } // Display post meta - author, category, and comments $post_author = ''.esc_html__( 'Posted by', 'bento' ).' '.get_the_author().''; $post_categories_ids = wp_get_post_categories( get_the_ID(), array('fields' => 'ids') ); $post_categories_names = array(); $post_categories = ''; if ( ! empty($post_categories_ids) && ( ! in_category('Uncategorized') ) ) { foreach ( $post_categories_ids as $c ) { $cat = get_category( $c ); $post_categories_names[] = $cat->name; } $post_categories_names = implode(", ", $post_categories_names); $post_categories = ' '.esc_html__( 'in', 'bento' ).' '.esc_html( $post_categories_names ).''; } $post_comments = ''; $num_comments = get_comments_number(); if ( comments_open() ) { if ( $num_comments == 0 ) { $comments = esc_html__( '0 comments', 'bento' ); } elseif ( $num_comments > 1 ) { $comments = $num_comments .' '. esc_html__( 'comments', 'bento' ); } else { $comments = esc_html__( '1 comment', 'bento' ); } $post_comments = ', '. $comments . ''; } $post_meta = $post_author . $post_categories . $post_comments; if ( get_post_type() == 'post' ) { echo wp_kses( $post_meta, array( 'span' => array( 'class' => array() ), 'i' => array() ) ); } edit_post_link( esc_html__( 'Edit this', 'bento' ), '
', '
' ); echo ''; } } // Display author information in posts if ( ! function_exists( 'bento_author_info' ) ) { function bento_author_info() { if ( is_singular('post') && get_theme_mod( 'bento_author_meta' ) != 1 ) { ?>

1 && get_option( 'page_comments' ) ) { ?>
id="comment-">
comment_type, array( 'pingback','trackback') ) ) { comment_author_link(); } else { comment_author(); } ?>
$depth, ) ) ); ?>
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() { $quote = esc_html( get_the_content() ); $author = esc_html( get_the_title() ); $output = '
'.$quote.'
'; 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 = esc_html__( 'Bento theme by', 'bento' ).' SatoriStudio'; } $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_title.'

'.$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; } } ?>