%s', esc_url( get_author_posts_url( $author_id ) ), esc_html( get_the_author() ) ); $rt = '' . $byline . ''; return $rt; } endif; if ( ! function_exists( 'bastet_posted_in' ) ) : /** * Prints HTML with meta information for the categories. */ function bastet_posted_in() { echo bastet_get_posted_in(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } endif; if ( ! function_exists( 'bastet_get_posted_in' ) ) : /** * Return HTML with meta information for the categories. */ function bastet_get_posted_in() { $categories_list = get_the_category_list( ' ' ); $rt = ''; $categories = get_the_category(); if ( $categories_list && bastet_categorized_blog() ) { $rt .= ''; foreach ( $categories as $category ) { $rt .= sprintf( '%s', esc_url( get_category_link( $category->term_id ) ), esc_html( $category->name ) ); } $rt .= ''; } return $rt; } endif; if ( ! function_exists( 'bastet_posts_pagination' ) ) : /** * Print HTML for loop query pagination. * * @param string $type Can be numbers or load-more. * @param WP_Query $query WordPress Query object. * @param array $meta List of post meta to show. */ function bastet_posts_pagination( $type = 'numbers', $query = '', $meta = array() ) { echo bastet_get_posts_pagination( $type, $query, $meta ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } endif; if ( ! function_exists( 'bastet_get_posts_pagination' ) ) : /** * Return HTML for loop query pagination. * * @global WP_Query $wp_query WordPress Query object. * * @param string $type Can be numbers or load-more. * @param WP_Query $query WordPress Query object. * @param array $meta List of post meta to show. */ function bastet_get_posts_pagination( $type = 'numbers', $query = '', $meta = array() ) { global $wp_query; $query = empty( $query ) ? $wp_query : $query; $rt = ''; if ( 'load-more' === $type ) { $rt = bastet_get_load_more_button( $query, $meta ); } elseif ( 'numbers' === $type ) { $rt = bastet_get_paginate_numbers( $query ); } return $rt; } endif; if ( ! function_exists( 'bastet_get_load_more_button' ) ) : /** * Return HTML for load more button based on the query param. * * @param WP_Query $query WordPress Query object. * @param array $meta List of post meta to show. */ function bastet_get_load_more_button( $query = '', $meta = array() ) { $meta = empty( $meta ) ? bastet_get_layout_modes() : $meta; $query = is_object( $query ) ? $query->query_vars : $query; $remove = array( 'cache_results', 'update_post_meta_cache', 'update_post_term_cache', 'suppress_filters', 'attachment', 'attachment_id', 'lazy_load_term_meta', 'nopaging', 'error', 'p', 'm', 'subpost_id', 'comments_per_page', 'no_found_rows', 'menu_order', 'embed', 'post_parent', 'subpost', ); $query = array_diff_key( $query, array_flip( $remove ) ); $rt = sprintf( ' ', esc_html__( 'Posts Navigation', 'bastet' ), esc_html__( 'No more stories :(', 'bastet' ), esc_html__( 'Load More', 'bastet' ), esc_attr( wp_json_encode( $query ) ), esc_attr( wp_json_encode( $meta ) ) ); return $rt; } endif; if ( ! function_exists( 'bastet_get_paginate_numbers' ) ) { /** * Return HTML for pages number with next/prev button. * * @global WP_Query $wp_query WordPress Query object. * @global int $paged Page number of a list of posts. * @param WP_Query $query WordPress Query object. */ function bastet_get_paginate_numbers( $query = '' ) { global $wp_query; if ( empty( $query ) ) { return null; } if ( ! empty( $wp_query ) && isset( $wp_query->query['paged'] ) ) { $paged = $wp_query->query['paged']; } else { $paged = 1; } $links = paginate_links( array( 'type' => 'array', 'total' => $query->max_num_pages, 'current' => max( 1, $paged ), 'prev_text' => bastet_get_svg_icon( 'arrow-right' ) . '' . esc_html__( 'Previous Page', 'bastet' ) . '', 'next_text' => '' . esc_html__( 'Next Page', 'bastet' ) . '' . bastet_get_svg_icon( 'arrow-right' ), ) ); $links = isset( $links ) ? array_map( 'bastet_map_paginate_numbers', $links ) : array(); $rt = ''; return $rt; } } if ( ! function_exists( 'bastet_post_date' ) ) : /** * Print HTML with meta information for post date. * * @param int $post_id Post ID. */ function bastet_post_date( $post_id ) { echo bastet_get_post_date( $post_id ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } endif; if ( ! function_exists( 'bastet_get_post_date' ) ) : /** * Return HTML with meta information for post date. * * @param int $post_id Post ID. */ function bastet_get_post_date( $post_id ) { $time_string = ' '; $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c', $post_id ) ), esc_html( get_the_date() ), esc_url( get_permalink( $post_id ) ) ); $rt = '' . $time_string . ''; return $rt; } endif; if ( ! function_exists( 'bastet_entry_footer' ) ) : /** * Print HTML with post tag and share icons. */ function bastet_entry_footer() { if ( 'post' === get_post_type() && is_single() ) { /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list( '', '' ); if ( $tags_list ) { printf( '%2$s%1$s', $tags_list, // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped esc_html__( 'Tags', 'bastet' ) ); } bastet_share_buttons( get_the_ID() ); } } endif; if ( ! function_exists( 'bastet_read_more_btn' ) ) : /** * Print HTML with read more button. */ function bastet_read_more_btn() { echo bastet_get_read_more_btn(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } endif; if ( ! function_exists( 'bastet_get_read_more_btn' ) ) : /** * Return HTML with read more button. */ function bastet_get_read_more_btn() { return sprintf( '%2$s', esc_url( get_the_permalink() ), esc_html__( 'Read More', 'bastet' ) ); } endif; if ( ! function_exists( 'bastet_render_logo' ) ) : /** * Return HTML|String for site logo and header scroll logo. */ function bastet_site_brand() { echo bastet_get_site_brand(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } endif; if ( ! function_exists( 'bastet_get_site_brand' ) ) : /** * Return HTML|String for site logo and header scroll logo. */ function bastet_get_site_brand() { $image_id = get_theme_mod( 'custom_logo', '' ); $image_id_scroll = get_theme_mod( 'header_scroll_logo', '' ); $logo = wp_get_attachment_image_src( $image_id, 'full' ); $logo_scroll = wp_get_attachment_image_src( $image_id_scroll, 'full' ); $out = ''; if ( has_custom_logo() && $logo ) { $out .= sprintf( '', esc_url( $logo[0] ), esc_attr( get_bloginfo( 'name' ) ) ); if ( ! empty( $image_id_scroll ) && $logo_scroll ) { $out .= sprintf( '', esc_url( $logo_scroll[0] ), get_bloginfo( 'name' ) ); } } else { return get_bloginfo( 'name' ); } return $out; } endif; if ( ! function_exists( 'bastet_custom_excerpt' ) ) : /** * Print post excerpt based on number of words. * * @param int $limit Number of words. * @param bool $more Display more tag. */ function bastet_custom_excerpt( $limit, $more = false ) { echo wp_kses( bastet_get_custom_excerpt( $limit, $more ), array( 'a' => array( 'class' => array(), 'href' => array(), ), 'p' => array( 'class' => array() ), 'span' => array( 'class' => array() ), ) ); } endif; if ( ! function_exists( 'bastet_get_custom_excerpt' ) ) : /** * Return post excerpt based on number of words. * * @param int $limit Number of words. * @param bool $more Display more tag. */ function bastet_get_custom_excerpt( $limit, $more = false ) { $excerpt = explode( ' ', get_the_excerpt(), $limit ); if ( count( $excerpt ) >= $limit ) { array_pop( $excerpt ); $excerpt = implode( ' ', $excerpt ); } else { $excerpt = implode( ' ', $excerpt ); } $excerpt = preg_replace( '`\[[^\]]*\]`', '', $excerpt ); $more = $more ? sprintf( '%2$s', esc_url( get_the_permalink() ), esc_html__( 'Read More', 'bastet' ) ) : ''; $rt = sprintf( '

%s %s

', esc_html( $excerpt ), $more ); return $rt; } endif; if ( ! function_exists( 'bastet_short_excerpt' ) ) : /** * Number of words for short excerpt. */ function bastet_short_excerpt() { return 16; } endif; if ( ! function_exists( 'bastet_categorized_blog' ) ) : /** * Are we on blog with more than 2 categories ? */ function bastet_categorized_blog() { $all_the_cool_cats = get_transient( 'bastet_categories' ); if ( false === $all_the_cool_cats ) { $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( 'bastet_categories', $all_the_cool_cats ); } if ( $all_the_cool_cats > 1 ) { return true; } else { return false; } } endif; if ( ! function_exists( 'bastet_sanitize_output' ) ) : /** * Wrapper function to avoid printing direct variables * * @param string $toescape escaped content. */ function bastet_sanitize_output( $toescape ) { return $toescape; } endif; if ( ! function_exists( 'bastet_header_class' ) ) : /** * Print HTML with header class and class attribute * * @param array $class List of classes. */ function bastet_header_class( $class = array() ) { $classes = array(); $classes[] = 'site-header'; $classes[] = get_theme_mod( 'header_style', 'light' ); $classes[] = get_theme_mod( 'header_style', 'light' ) === 'transparent' ? 'light transparent' : ''; if ( get_theme_mod( 'header_search', 1 ) ) { $classes[] = 'with-search'; } if ( get_theme_mod( 'header_shy', 0 ) ) { $classes[] = 'smart-mode'; } if ( get_theme_mod( 'header_fixed', 0 ) ) { $classes[] = 'fixed-mode'; } if ( is_admin_bar_showing() ) { $class[] = 'with-admin-bar'; } $classes = array_merge( $classes, $class ); $classes = array_map( 'esc_attr', $classes ); $classes = apply_filters( 'bastet_header_classes', $classes, $class ); echo 'class="' . esc_attr( join( ' ', $classes ) ) . '"'; } endif; if ( ! function_exists( 'bastet_main_nav' ) ) : /** * Print site main navigation * * @param array $args wp_nav_menu args. */ function bastet_main_nav( $args = array() ) { echo bastet_get_main_nav( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } endif; if ( ! function_exists( 'bastet_get_primary_menu' ) ) : /** * Return site main navigation * * @param array $args wp_nav_menu args. */ function bastet_get_primary_menu( $args = array() ) { $menu_args = array( 'theme_location' => 'primary', 'depth' => 3, 'container' => false, 'fallback_cb' => 'Bootstrap_Walker::fallback', 'menu_class' => 'navbar-nav', 'walker' => new Bastet_Bootstrap_Walker(), 'echo' => false, ); $menu_args = wp_parse_args( $args, $menu_args ); return wp_nav_menu( $menu_args ); } endif; if ( ! function_exists( 'bastet_get_main_nav' ) ) : /** * Return HTML with site main navigation * * @param array $args wp_nav_menu args. */ function bastet_get_main_nav( $args = array() ) { ob_start(); echo sprintf( '', esc_html__( 'Toggle navigation', 'bastet' ), wp_kses( bastet_get_svg_icon( 'menu' ), bastet_allowed_svg_markup() ) ); echo ''; return ob_get_clean(); } endif; if ( ! function_exists( 'bastet_get_sidebar_position' ) ) : /** * Return theme mod for current page sidebar position */ function bastet_get_sidebar_position() { $mod_name = 'bastet_sidebar_' . bastet_current_page_name() . ''; if ( is_home() || is_front_page() ) { return ! is_active_sidebar( 'sidebar' ) ? 'no-sidebar' : get_theme_mod( $mod_name, 'right-sidebar' ); } elseif ( is_single() ) { return ! is_active_sidebar( 'post' ) ? 'no-sidebar' : get_theme_mod( $mod_name, 'right-sidebar' ); } elseif ( is_page() ) { return ! is_active_sidebar( 'page' ) ? 'no-sidebar' : get_theme_mod( $mod_name, 'right-sidebar' ); } return ! is_active_sidebar( 'sidebar' ) ? 'no-sidebar' : get_theme_mod( $mod_name, 'right-sidebar' ); } endif; if ( ! function_exists( 'bastet_get_posts_layout' ) ) : /** * Return theme mod for query layout */ function bastet_get_posts_layout() { $mod_name = 'bastet_layout_' . bastet_current_page_name() . ''; $query_var = get_query_var( 'bastet_mods' ); if ( ! empty( $query_var ) ) { return get_query_var( $query_var['layout'] ); } return get_theme_mod( $mod_name, 'card' ); } endif; if ( ! function_exists( 'bastet_get_posts_layout_meta' ) ) : /** * Return theme mod for enabled post meta * * @param string $meta meta name. * @param bool $default default state. */ function bastet_get_posts_layout_meta( $meta, $default = 1 ) { $mod_name = 'bastet_' . $meta . '_' . bastet_current_page_name() . ''; $query_var = get_query_var( 'bastet_mods' ); if ( ! empty( $query_var ) ) { return (int) $query_var[ $meta ]; } return get_theme_mod( $mod_name, $default ); } endif; if ( ! function_exists( 'bastet_get_post_layout' ) ) : /** * Return theme mod for single post layout */ function bastet_get_post_layout() { $mod_name = 'bastet_layout_' . bastet_current_page_name() . ''; $query_var = get_query_var( 'bastet_mods' ); if ( ! empty( $query_var ) ) { return esc_attr( get_query_var( $query_var['layout'] ) ); } return get_theme_mod( $mod_name, 'large-header' ); } endif; if ( ! function_exists( 'bastet_get_post_layout_meta' ) ) : /** * Return theme mod for enabled post meta on single post * * @param string $meta meta name. * @param bool $default default state. */ function bastet_get_post_layout_meta( $meta, $default = 1 ) { $mod_name = 'bastet_' . $meta . '_' . bastet_current_page_name() . ''; $query_var = get_query_var( 'bastet_mods' ); if ( ! empty( $query_var ) ) { return (int) $query_var[ $meta ]; } return get_theme_mod( $mod_name, $default ); } endif; if ( ! function_exists( 'bastet_comments_count' ) ) : /** * Return number of comments for given post id * * @param int $id Post ID. */ function bastet_comments_count( $id = 0 ) { $num_comments = get_comments_number( $id ); if ( comments_open( $id ) ) { if ( 0 === $num_comments ) { $comments = esc_html__( '0 Comment', 'bastet' ); } elseif ( $num_comments > 1 ) { $comments = $num_comments . esc_html__( ' Comments', 'bastet' ); } else { $comments = esc_html__( '1 Comment', 'bastet' ); } $write_comments = $comments; } else { $write_comments = esc_html__( 'Comments are off', 'bastet' ); } return $write_comments; } endif; if ( ! function_exists( 'wp_body_open' ) ) : /** * Backward compatibility for WordPress older than 5.2 */ function wp_body_open() { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound do_action( 'wp_body_open' ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound } endif; if ( ! function_exists( 'bastet_the_archive_title' ) ) : /** * Print current archive page title and tag * * @param string $before HTML before title. * @param string $after HTML after title. */ function bastet_the_archive_title( $before = '', $after = '' ) { $allowed_html = array( 'h1' => array( 'class' => array() ), 'p' => array(), 'span' => array( 'class' => array() ), ); $tag_title = ''; if ( is_category() ) { $tag_title = '' . esc_html__( 'Category', 'bastet' ) . ''; $title = single_cat_title( '', false ); } elseif ( is_tag() ) { $tag_title = '' . esc_html__( 'Tag', 'bastet' ) . ''; $title = single_tag_title( '', false ); } elseif ( is_author() ) { $tag_title = '' . esc_html__( 'Author Archive', 'bastet' ) . ''; $title = '' . get_the_author() . ''; } elseif ( is_year() ) { $tag_title = '' . esc_html__( 'Year', 'bastet' ) . ''; $title = get_the_date( _x( 'Y', 'yearly archives date format', 'bastet' ) ); } elseif ( is_month() ) { $tag_title = '' . esc_html__( 'Month', 'bastet' ) . ''; $title = get_the_date( _x( 'F Y', 'monthly archives date format', 'bastet' ) ); } elseif ( is_day() ) { $tag_title = '' . esc_html__( 'Day', 'bastet' ) . ''; $title = get_the_date( _x( 'F j, Y', 'daily archives date format', 'bastet' ) ); } elseif ( is_tax( 'post_format', 'post-format-aside' ) ) { $title = _x( 'Asides', 'post format archive title', 'bastet' ); } elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) { $title = _x( 'Galleries', 'post format archive title', 'bastet' ); } elseif ( is_tax( 'post_format', 'post-format-image' ) ) { $title = _x( 'Images', 'post format archive title', 'bastet' ); } elseif ( is_tax( 'post_format', 'post-format-video' ) ) { $title = _x( 'Videos', 'post format archive title', 'bastet' ); } elseif ( is_tax( 'post_format', 'post-format-quote' ) ) { $title = _x( 'Quotes', 'post format archive title', 'bastet' ); } elseif ( is_tax( 'post_format', 'post-format-link' ) ) { $title = _x( 'Links', 'post format archive title', 'bastet' ); } elseif ( is_tax( 'post_format', 'post-format-status' ) ) { $title = _x( 'Statuses', 'post format archive title', 'bastet' ); } elseif ( is_tax( 'post_format', 'post-format-audio' ) ) { $title = _x( 'Audio', 'post format archive title', 'bastet' ); } elseif ( is_tax( 'post_format', 'post-format-chat' ) ) { $title = _x( 'Chats', 'post format archive title', 'bastet' ); } elseif ( is_post_type_archive() ) { /* translators: %s: post type archive */ $title = sprintf( esc_html__( 'Archives: %s', 'bastet' ), post_type_archive_title( '', false ) ); } elseif ( is_tax() ) { $tax = get_taxonomy( get_queried_object()->taxonomy ); $tag_title = sprintf( '%1$s', esc_html( $tax->labels->singular_name ) ); $title = single_term_title( '', false ); } else { $title = esc_html__( 'Archives', 'bastet' ); } /** * Filter the archive title. * * @param string $title Archive title to be displayed. */ $title = apply_filters( 'bastet_the_archive_title', $title ); $tag_title = apply_filters( 'bastet_the_archive_tag_title', $tag_title ); if ( ! empty( $title ) ) { echo wp_kses( $tag_title, $allowed_html ) . wp_kses( $before, $allowed_html ) . wp_kses( $title, $allowed_html ) . wp_kses( $after, $allowed_html ); } } endif; if ( ! function_exists( 'bastet_the_archive_description' ) ) : /** * Print current archive page description * * @param string $before HTML before description. * @param string $after HTML after description. */ function bastet_the_archive_description( $before = '', $after = '' ) { $allowed_html = array( 'div' => array( 'class' => array() ), 'p' => array(), 'span' => array( 'class' => array() ), ); $description = apply_filters( 'bastet_the_archive_description', term_description() ); if ( ! empty( $description ) ) { echo wp_kses( $before, $allowed_html ) . wp_kses( $description, $allowed_html ) . wp_kses( $after, $allowed_html ); } } endif; if ( ! function_exists( 'bastet_the_search_title' ) ) : /** * Print search page query * * @param string $before HTML before search title. * @param string $after HTML after search title. */ function bastet_the_search_title( $before = '', $after = '' ) { $allowed_html = array( 'h1' => array( 'class' => array() ), 'p' => array(), 'span' => array( 'class' => array() ), ); $title = sprintf( '%s%s', esc_html__( 'Search Results For: ', 'bastet' ), get_search_query() ); echo wp_kses( $before, $allowed_html ) . apply_filters( 'bastet_the_search_title', $title ) . wp_kses( $after, $allowed_html ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } endif; if ( ! function_exists( 'bastet_the_search_count' ) ) : /** * Print the number of found posts on search * * @param string $before HTML before search count. * @param string $after HTML after search count. */ function bastet_the_search_count( $before = '', $after = '' ) { global $wp_query; $allowed_html = array( 'h1' => array( 'class' => array() ), 'p' => array(), 'span' => array( 'class' => array() ), ); $title = sprintf( '%s %s', esc_html( $wp_query->found_posts ), esc_html__( 'Results', 'bastet' ) ); echo wp_kses( $before, $allowed_html ) . apply_filters( 'bastet_the_search_count', $title ) . wp_kses( $after, $allowed_html ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } endif; if ( ! function_exists( 'bastet_the_author_post_link' ) ) : /** * Print the author link with first and last name */ function bastet_get_the_author_post_link() { global $authordata; $first_name = get_the_author_meta( 'first_name', $authordata->ID ); $last_name = get_the_author_meta( 'last_name', $authordata->ID ); $link = sprintf( '', esc_url( get_author_posts_url( $authordata->ID, $authordata->user_nicename ) ), /* translators: %s: Author's display name. */ esc_attr( sprintf( __( 'Posts by %s', 'bastet' ), get_the_author() ) ), empty( $first_name ) ? get_the_author() : esc_html( $first_name . ' ' . $last_name ) ); return $link; } endif; if ( ! function_exists( 'bastet_comments' ) ) : /** * Print HTML for comment * * @param object $comment Comment object. * @param array $args Comment arg. * @param string $depth Comment depth. */ function bastet_comments( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited ?>
  • id="comment-">
    user_id ) { $user = get_userdata( $comment->user_id ); if ( ! empty( $user->user_url ) ) { printf( '%2$s', esc_url( $user->user_url ), esc_html( $user->display_name ) ); } else { echo esc_html( $user->display_name ); } } else { comment_author_link(); } ?>
    comment_approved ) : ?>
  • %s
    ', bastet_get_site_brand(), wp_kses( bastet_get_svg_icon( 'cancel' ), bastet_allowed_svg_markup() ) ); } endif; if ( ! function_exists( 'bastet_offcanvas_sidebar' ) ) : /** * Print HTML for off canvas sidebar */ function bastet_offcanvas_sidebar() { $header_style = get_theme_mod( 'header_style', 'light' ); $class = ''; if ( 'solid' === $header_style ) { $class = 'left'; } echo '
    '; echo '
    '; echo bastet_get_offcanvas_header(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo bastet_get_primary_menu( array( 'walker' => new Bastet_Bootstrap_Walker() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped bastet_sidebar_area( 'offcanvas-sidebar' ); echo '
    '; } endif; if ( ! function_exists( 'bastet_offcanvas_search' ) ) : /** * Print HTML for off canvas search form */ function bastet_offcancas_search() { echo '
    '; echo ''; } endif; if ( ! function_exists( 'bastet_social_icons' ) ) : /** * Print HTML for social icons * * @param array $social_icons List of social icons. * @param string $class Wrapper class. */ function bastet_social_icons( $social_icons = array(), $class = '' ) { echo '
    '; foreach ( $social_icons as $icon ) : printf( '%s', esc_url( $icon['url'] ), 'social-' . esc_attr( $icon['provider'] ), wp_kses( bastet_get_svg_icon( 'social/' . $icon['provider'] ), bastet_allowed_svg_markup() ) ); endforeach; echo '
    '; } endif; if ( ! function_exists( 'bastet_sidebar' ) ) : /** * Print HTML sidebar with bootstrap class */ function bastet_sidebar() { $sidebar = bastet_get_sidebar_position(); if ( 'left-sidebar' === $sidebar || 'right-sidebar' === $sidebar ) : $sidebar_class = ''; if ( 'left-sidebar' === $sidebar ) { $sidebar_class = 'order-lg-1'; } echo sprintf( ''; endif; } endif;