' . $categories_list . '
';
}
}
}
endif;
if( ! function_exists( 'rara_business_tags' ) ) :
/**
* Tags
*/
function rara_business_tags(){
// Hide category and tag text for pages.
if ( 'post' === get_post_type() ) {
$tags_list = get_the_tag_list( '', ' ' );
if ( $tags_list ) {
echo '' . $tags_list . '';
}
}
}
endif;
if( ! function_exists( 'rara_business_theme_comment' ) ) :
/**
* Callback function for Comment List *
*
* @link https://codex.wordpress.org/Function_Reference/wp_list_comments
*/
function rara_business_theme_comment( $comment, $args, $depth ){
if ( 'div' == $args['style'] ) {
$tag = 'div';
$add_below = 'comment';
} else {
$tag = 'li';
$add_below = 'div-comment';
}
?>
< id="comment-">
';
foreach( $social_links as $link ){
if( $link['link'] && $link['font'] ) echo '
';
}
echo '';
}
}
endif;
if( ! function_exists( 'rara_business_site_branding' ) ) :
/**
* Site Branding
*/
function rara_business_site_branding(){
$display_header_text = get_theme_mod( 'header_text', 1 );
$site_title = get_bloginfo( 'name', 'display' );
$description = get_bloginfo( 'description', 'display' );
if( ( function_exists( 'has_custom_logo' ) && has_custom_logo() ) && $display_header_text && ( ! empty( $site_title ) || ! empty( $description ) ) ){
$branding_class = 'logo-with-site-identity';
} else {
$branding_class = '';
} ?>
';
if( is_front_page() ){ ?>
';
?>
' . esc_html( $label ) . '';
} else {
echo '
' . esc_html( $label ) . '';
}
}
endif;
if( ! function_exists( 'rara_business_primary_menu_fallback' ) ) :
/**
* Primary Menu Fallback
*/
function rara_business_primary_menu_fallback(){
if( current_user_can( 'manage_options' ) ){
echo '';
}
}
endif;
if( ! function_exists( 'rara_business_get_home_sections' ) ) :
/**
* Returns Home Sections
*/
function rara_business_get_home_sections(){
$sections = array(
'services' => array( 'sidebar' => 'services' ),
'about' => array( 'sidebar' => 'about' ),
'choose-us' => array( 'sidebar' => 'choose-us' ),
'team' => array( 'sidebar' => 'team' ),
'testimonial' => array( 'sidebar' => 'testimonial' ),
'stats' => array( 'sidebar' => 'stats' ),
'portfolio' => array( 'section' => 'portfolio' ),
'blog' => array( 'section' => 'blog' ),
'cta' => array( 'sidebar' => 'cta' ),
'faq' => array( 'sidebar' => 'faq' ),
'client' => array( 'sidebar' => 'client' )
);
$enabled_section = array();
foreach( $sections as $k => $v ){
if( array_key_exists( 'sidebar', $v ) ){
if( is_active_sidebar( $v['sidebar'] ) ) array_push( $enabled_section, $v['sidebar'] );
}else{
if( get_theme_mod( 'ed_' . $v['section'] . '_section', true ) ) array_push( $enabled_section, $v['section'] );
}
}
return apply_filters( 'rara_business_home_sections', $enabled_section );
}
endif;
if( ! function_exists( 'rara_business_get_portfolio_buttons' ) ) :
/**
* Query for Portfolio Buttons
*/
function rara_business_get_portfolio_buttons( $no_of_portfolio, $home = false ){
if( taxonomy_exists( 'rara_portfolio_categories' ) ){
if( $home ){
$s = '';
$i = 0;
$portfolio_posts = get_posts( array( 'post_type' => 'rara-portfolio', 'post_status' => 'publish', 'posts_per_page' => $no_of_portfolio ) );
foreach( $portfolio_posts as $portfolio ){
$terms = get_the_terms( $portfolio->ID, 'rara_portfolio_categories' );
if( $terms ){
foreach( $terms as $term ){
$i++;
$s .= $term->term_id;
$s .= ', ';
}
}
}
$term_ids = explode( ', ', $s );
$term_ids = array_diff( array_unique( $term_ids ), array('') );
wp_reset_postdata();//Reseting get_posts
}
$args = array(
'taxonomy' => 'rara_portfolio_categories',
'orderby' => 'name',
'order' => 'ASC',
);
$terms = get_terms( $args );
if( $terms ){
?>
term_id, $term_ids ) )
echo '';
}else{
echo '';
}
}
?>
'rara-portfolio', 'post_status' => 'publish', 'posts_per_page' => $no_of_portfolio ) );
if( taxonomy_exists( 'rara_portfolio_categories' ) && $portfolio_qry->have_posts() ){ ?>
have_posts() ){
$portfolio_qry->the_post();
$terms = get_the_terms( get_the_ID(), 'rara_portfolio_categories' );
$s = '';
$n = '';
$i = 0;
if( $terms ){
foreach( $terms as $t ){
$i++;
$s .= $t->slug;
$n .= '#'.$t->name;
if( count( $terms ) > $i ){
$s .= ' ';
$n .= ' ';
}
}
}
if( has_post_thumbnail() ){ ?>
', '' );
if( $n ) echo '
'. esc_html( $n ) .'
';
?>
'',
'title' => '',
'desc' => '',
'fallback' => false,
);
// Parse args.
$args = wp_parse_args( $args, $defaults );
// Set aria hidden.
$aria_hidden = ' aria-hidden="true"';
// Set ARIA.
$aria_labelledby = '';
/*
* Restaurant and Cafe Pro doesn't use the SVG title or description attributes; non-decorative icons are described with .screen-reader-text.
*
* However, child themes can use the title and description to add information to non-decorative SVG icons to improve accessibility.
*
* Example 1 with title: 'arrow-right', 'title' => __( 'This is the title', 'textdomain' ) ) ); ?>
*
* Example 2 with title and description: 'arrow-right', 'title' => __( 'This is the title', 'textdomain' ), 'desc' => __( 'This is the description', 'textdomain' ) ) ); ?>
*
* See https://www.paciellogroup.com/blog/2013/12/using-aria-enhance-svg-accessibility/.
*/
if ( $args['title'] ) {
$aria_hidden = '';
$unique_id = uniqid();
$aria_labelledby = ' aria-labelledby="title-' . $unique_id . '"';
if ( $args['desc'] ) {
$aria_labelledby = ' aria-labelledby="title-' . $unique_id . ' desc-' . $unique_id . '"';
}
}
// Begin SVG markup.
$svg = '
';
return $svg;
}
endif;
if( ! function_exists( 'rara_business_sidebar_layout' ) ) :
/**
* Return sidebar layouts for pages/posts
*/
function rara_business_sidebar_layout(){
global $post;
$return = false;
$page_layout = get_theme_mod( 'page_sidebar_layout', 'right-sidebar' ); //Default Layout Style for Pages
$post_layout = get_theme_mod( 'post_sidebar_layout', 'right-sidebar' ); //Default Layout Style for Posts
if( is_singular( array( 'page', 'post' ) ) ){
if( get_post_meta( $post->ID, 'sidebar_layout', true ) ){
$sidebar_layout = get_post_meta( $post->ID, 'sidebar_layout', true );
}else{
$sidebar_layout = 'default-sidebar';
}
if( is_page() ){
if( is_page_template( 'templates/portfolio.php' ) ){
$return = '';
}elseif( is_active_sidebar( 'sidebar' ) ){
if( $sidebar_layout == 'no-sidebar' ){
$return = 'full-width';
}elseif( ( $sidebar_layout == 'default-sidebar' && $page_layout == 'right-sidebar' ) || ( $sidebar_layout == 'right-sidebar' ) ){
$return = 'rightsidebar';
}elseif( ( $sidebar_layout == 'default-sidebar' && $page_layout == 'left-sidebar' ) || ( $sidebar_layout == 'left-sidebar' ) ){
$return = 'leftsidebar';
}elseif( $sidebar_layout == 'default-sidebar' && $page_layout == 'no-sidebar' ){
$return = 'full-width';
}
}else{
$return = 'full-width';
}
}elseif( is_single() ){
if( is_active_sidebar( 'sidebar' ) ){
if( $sidebar_layout == 'no-sidebar' ){
$return = 'full-width';
}elseif( ( $sidebar_layout == 'default-sidebar' && $post_layout == 'right-sidebar' ) || ( $sidebar_layout == 'right-sidebar' ) ){
$return = 'rightsidebar';
}elseif( ( $sidebar_layout == 'default-sidebar' && $post_layout == 'left-sidebar' ) || ( $sidebar_layout == 'left-sidebar' ) ){
$return = 'leftsidebar';
}elseif( $sidebar_layout == 'default-sidebar' && $post_layout == 'no-sidebar' ){
$return = 'full-width';
}
}else{
$return = 'full-width';
}
}
}elseif( is_tax( 'rara_portfolio_categories' ) ){
$return = 'page-template-portfolio';
}elseif( is_singular( 'rara-portfolio' ) ){
$return = 'full-width';
}elseif( rara_business_is_woocommerce_activated() && is_post_type_archive( 'product' ) ){
if( is_active_sidebar( 'shop-sidebar' ) ){
$return = 'rightsidebar';
}else{
$return = 'full-width';
}
}else{
if( is_active_sidebar( 'sidebar' ) ){
$return = 'rightsidebar';
}else{
$return = 'full-width';
}
}
return $return;
}
endif;
if( ! function_exists( 'rara_business_escape_text_tags' ) ) :
/**
* Remove new line tags from string
*
* @param $text
*
* @return string
*/
function rara_business_escape_text_tags( $text ) {
return (string) str_replace( array( "\r", "\n" ), '', strip_tags( $text ) );
}
endif;
if( ! function_exists( 'rara_business_fonts_url' ) ) :
/**
* Register custom fonts.
*/
function rara_business_fonts_url() {
$fonts_url = '';
/*
* Translators: If there are characters in your language that are not
* supported by Lato fonts, translate this to 'off'. Do not translate
* into your own language.
*/
$lato_font = _x( 'on', 'Lato font: on or off', 'rara-business' );
/*
* Translators: If there are characters in your language that are not
* supported by Montserrat fonts, translate this to 'off'. Do not translate
* into your own language.
*/
$montserrat_font = _x( 'on', 'Montserrat font: on or off', 'rara-business' );
if ( 'off' !== $lato_font || 'off' !== $montserrat_font ) {
$font_families = array();
if ( 'off' !== $lato_font ) {
$font_families[] = 'Lato:100,100i,300,300i,400,400i,700,700i,900,900i';
}
if ( 'off' !== $montserrat_font ) {
$font_families[] = 'Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i';
}
$query_args = array(
'family' => urlencode( implode( '|', $font_families ) ),
'subset' => urlencode( 'latin,latin-ext' ),
'display' => urlencode( 'fallback' ),
);
$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
}
return esc_url( $fonts_url );
}
endif;
if ( ! function_exists( 'wp_body_open' ) ) :
/**
* Fire the wp_body_open action.
*
* Added for backwards compatibility to support pre 5.2.0 WordPress versions.
*
*/
function wp_body_open() {
/**
* Triggered after the opening tag.
*
*/
do_action( 'wp_body_open' );
}
endif;
if( ! function_exists( 'rara_business_load_preload_local_fonts') ) :
/**
* Get the file preloads.
*
* @param string $url The URL of the remote webfont.
* @param string $format The font-format. If you need to support IE, change this to "woff".
*/
function rara_business_load_preload_local_fonts( $url, $format = 'woff2' ) {
// Check if cached font files data preset present or not. Basically avoiding 'rara_business_WebFont_Loader' class rendering.
$local_font_files = get_site_option( 'rara_business_local_font_files', false );
if ( is_array( $local_font_files ) && ! empty( $local_font_files ) ) {
$font_format = apply_filters( 'rara_business_local_google_fonts_format', $format );
foreach ( $local_font_files as $key => $local_font ) {
if ( $local_font ) {
echo '
'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
return;
}
// Now preload font data after processing it, as we didn't get stored data.
$font = rara_business_webfont_loader_instance( $url );
$font->set_font_format( $format );
$font->preload_local_fonts();
}
endif;
if( ! function_exists( 'rara_business_flush_local_google_fonts' ) ){
/**
* Ajax Callback for flushing the local font
*/
function rara_business_flush_local_google_fonts() {
$WebFontLoader = new Rara_Business_WebFont_Loader();
//deleting the fonts folder using ajax
$WebFontLoader->delete_fonts_folder();
die();
}
}
add_action( 'wp_ajax_flush_local_google_fonts', 'rara_business_flush_local_google_fonts' );
add_action( 'wp_ajax_nopriv_flush_local_google_fonts', 'rara_business_flush_local_google_fonts' );
%s says:', 'rara-business' ), get_comment_author_link() ); ?>