main();
}
}
add_action( 'bansta_load_header_page', 'bansta_load_header_style' );
function bansta_heading_tag_related() {
$heading = '
'.esc_html( 'Related Articles' ).'
';
echo $heading;
}
if ( ! function_exists( 'bansta_card_class' ) ) {
function bansta_card_class() {
$settings = bansta_get_setting();
$front_page = $settings['home_layout'];
$single_page = $settings['single_layout'];
$bansta_home = '';
if ( $front_page === 'home-card1' || $single_page === 'single-card1' && is_single() ) {
$bansta_home = esc_attr_e( 'card1', 'bansta' );
} elseif ( $front_page === 'home-card2' ) {
$bansta_home = esc_attr_e( 'card2', 'bansta' );
} elseif ( $front_page === 'home-card3' ) {
$bansta_home = esc_attr_e( 'card3', 'bansta' );
}
return $bansta_home;
}
}
if ( ! function_exists( 'bansta_offcanvas_class' ) ) {
function bansta_offcanvas_class() {
$theme_settings = bansta_get_setting();
$canvas = $theme_settings['header_style'];
if ( $canvas !== 'style-5' ) {
return;
}
if ( $canvas === 'style-5' ) {
echo 'off-canvas-wrapper';
}
return $canvas;
}
}
if ( ! function_exists( 'bansta_websafe_font' ) ) {
/**
* Function listing WebSafe Fonts and its attributes
*/
function bansta_websafe_font(){
$sytem = 'var(--system-font)';
$georgia = 'Georgia, serif';
$arial = 'Arial, Helvetica, sans-serif';
$ms = '"Comic Sans MS", cursive, sans-serif';
$lucida = '"Lucida Sans Unicode", "Lucida Grande", sans-serif';
$tahoma = 'Tahoma, Geneva, sans-serif';
$trebuchet = 'Trebuchet MS, sans-serif';
$verdana = 'Verdana, Geneva, sans-serif';
$standard_fonts = [
$sytem => 'System',
$georgia => 'Georgia',
$arial => 'Arial',
$ms => 'Comic Sans MS',
$lucida => 'Lucida Sans MS',
$tahoma => 'Tahoma',
$trebuchet => 'Trebuchet MS',
$verdana => 'Verdana',
];
return $standard_fonts;
}
}
if ( ! function_exists( 'bansta_title_tag' ) ) {
// title ellipsis
function bansta_title_tag($after, $length) {
$mytitle = explode(' ', get_the_title(), $length);
if (count($mytitle)>=$length) {
array_pop($mytitle);
$mytitle = implode(' ',$mytitle). $after;
} else {
$mytitle = implode(' ',$mytitle);
}
return $mytitle;
}
}
if ( ! function_exists( 'bansta_before_content_grid' ) ) {
function bansta_before_content_grid() {
$theme_settings = bansta_get_setting();
$grid = $theme_settings['big_grids_before_content'];
switch( $grid ) {
case 'default':
Big_grids::default();
break;
case 'grid-2':
Big_grids::grid_2();
break;
case 'grid-3':
Big_grids::grid_3();
break;
case 'grid-4':
Big_grids::grid_4();
break;
default:
Big_grids::default();
}
}
}
if ( ! function_exists( 'bansta_heading_style' ) ) {
function bansta_heading_style() {
$style = bansta_get_setting();
$class = '';
if ( ! class_exists( 'Ts_Framewk_Init' ) ) {
$class = ( $style['heading_style'] === 'default') ? esc_attr('heading-default') : esc_attr('heading-default');
} else {
$class = Ts_Pro_Settings::ts_heading();
}
return $class;
}
}
if ( ! function_exists( 'bansta_load_home_page' ) ) {
function bansta_load_home_page() {
$front = '';
if ( ! class_exists( 'Ts_Framewk_Init') ) {
$front = new Bansta_Home_Page_Loop();
$front->main_page();
} else {
$front = new Bansta_Pro_Home_Loop();
$front->main_page();
}
}
}
if ( ! function_exists( 'bansta_load_archive_page' ) ) {
function bansta_load_archive_page() {
$archive = '';
if ( ! class_exists( 'Ts_Framewk_Init') ) {
$archive = new Bansta_Archive_Page_Loop();
$archive->main_page();
} else {
$archive = new Bansta_Pro_Archive_Loop();
$archive->main_page();
}
}
}
if ( ! function_exists( 'bansta_load_search_page' ) ) {
function bansta_load_search_page() {
$archive = '';
if ( ! class_exists( 'Ts_Framewk_Init') ) {
$archive = new Bansta_Search_Page_Loop();
$archive->main_page();
} else {
$archive = new Bansta_Pro_Search_Loop();
$archive->main_page();
}
}
}
if ( ! function_exists( 'bansta_load_Single_page' ) ) {
function bansta_load_Single_page() {
$archive = '';
if ( ! class_exists( 'Ts_Framewk_Init') ) {
$archive = new Bansta_Single_Page_Loop();
$archive->main_page();
} else {
$archive = new Bansta_Pro_Single_Loop();
$archive->main_page();
}
}
}
if ( ! function_exists( 'basta_get_comment_form' ) ) {
function basta_get_comment_form($comment = '') {
$comment;
return apply_filters( 'bansta_single_comment_type', $comment );
}
}
if ( ! function_exists( 'bansta_single_wrapper_class' ) ) {
function bansta_single_wrapper_class( $classes = null ) {
$classes[] = '';
return apply_filters( 'bansta_single_wrapper_class', $classes );
}
}
if ( ! class_exists( 'bansta_copy_text') ) {
function bansta_copy_text($text) {
$default = bansta_get_default_option();
$text = $default['copy_text'];
return apply_filters('bansta_copy_text', $text );
}
}
if ( ! function_exists( 'bansta_ads_before_footer' ) ) {
function bansta_ads_before_footer() {
if ( is_ts_ads_exists() && ! is_singular( 'sponsored') ) {
$ad_setting = ts_settings();
if ( $ad_setting['bansta_show_ad_code_before_footer'] ) {
Ts_Ads::before_footer();
}
}
}
}
add_action( 'bansta_ads_before_footer', 'bansta_ads_before_footer' );