Sindbad~EG File Manager

Current Path : /var/www/html/wordpress_alg24news/wp-content/themes/newsbt-mobile/functions/
Upload File :
Current File : /var/www/html/wordpress_alg24news/wp-content/themes/newsbt-mobile/functions/single-elements.php

<?php
/*
 * Security 	: blocking direct access
 * Source		: http://codex.wordpress.org/Theme_Development#Template_Files
*/
defined('ABSPATH') or die("Access Restricted");
/*
 * Single
 *
 * Breadcrumbs
 *
*/
function mwp_display_breadcrumbs() {
	$options = get_option( 'wpseo_internallinks' );
	if ( function_exists('yoast_breadcrumb') && $options['breadcrumbs-enable'] == 1 ) { 
		yoast_breadcrumb('<div class="breadcrumbs">','</div>'); 
	} elseif ( function_exists( 'mwp_micro_breadcrumb' ) ) { 
		mwp_micro_breadcrumb();
	}		
}
/*!
 * Single
 *
 * Post Thumbnail
 *
*/
function mwp_single_thumbnail($postid) {
	
	$get_categories 		= mwp_option('remove-post-thumbnail');
	$instead_thumbnail 		= esc_attr(get_post_meta($postid, 'instead_thumbnail' , true));
	$instead_gallery 		= esc_attr(get_post_meta($postid, 'instead_gallery' , true));
	$html_instead_thumbnail = esc_attr(get_post_meta($postid, 'html_instead_thumbnail' , true));
	if (mwp_option('mobile-single-thumbnail') == 1) {
		if (!get_post_meta($postid, 'thumbnail_hide' , true)) {
			if (!in_category($get_categories, $postid) ) {
				/*
				 * Custom HTML Code Instead of Post Thumbnail
				*/
				if (!empty($html_instead_thumbnail)) { 
					echo '<div class="video vi-responsive">';
						echo stripslashes(stripslashes($html_instead_thumbnail));
					echo '</div>';
				} 
				/*
				 * Video Instead of Post Thumbnail
				*/
				elseif (!empty($instead_thumbnail)) {
					?>
					<div class="video">
						<?php 
						$source = get_post_meta($postid, 'instead_thumbnail_source' , true);
						echo '<div class="vi-responsive">';
						if (mwp_option('lazyload-mobile') == 1) {
							if ($source == 1) {
								echo '<iframe width="590" height="320" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" data-src="//www.youtube.com/embed/'.$instead_thumbnail.'?vq=hd720&amp;rel=0&amp;controls=1&amp;iv_load_policy=3&amp;disablekb=1&amp;modestbranding=1" allowfullscreen></iframe>';
							} elseif ($source == 2) {
								echo '<iframe width="590" height="320" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" data-src="//player.vimeo.com/video/'.$instead_thumbnail.'?portrait=0&amp;title=0&amp;badge=0" allowfullscreen></iframe>';
							} elseif ($source == 3) {
								echo '<iframe width="590" height="320" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" data-src="//www.dailymotion.com/embed/video/'.$instead_thumbnail.'?info=0&amp;logo=0&amp;related=0" allowfullscreen></iframe>';
							}
						} else {
							if ($source == 1) {
								echo '<iframe width="590" height="320" src="//www.youtube.com/embed/'.$instead_thumbnail.'?vq=hd720&amp;rel=0&amp;controls=1&amp;iv_load_policy=3&amp;disablekb=1&amp;modestbranding=1" allowfullscreen></iframe>';
							} elseif ($source == 2) {
								echo '<iframe width="590" height="320" src="//player.vimeo.com/video/'.$instead_thumbnail.'?portrait=0&amp;title=0&amp;badge=0" allowfullscreen></iframe>';
							} elseif ($source == 3) {
								echo '<iframe width="590" height="320" src="//www.dailymotion.com/embed/video/'.$instead_thumbnail.'?info=0&amp;logo=0&amp;related=0" allowfullscreen></iframe>';
							}
						}
						echo '</div>';
						?>
					</div>
					<?php
				} 
				/*
				 * Custom Gallery Instead of Post Thumbnail
				*/
				elseif (!empty($instead_gallery)) {
					mwp_optional_gallery($postid);
				} 
				/*
				 * Post Thumbnail
				*/
				else {
					$image_size 	= 'mwp-single';
					$image_margin 	= ' thumb-margin';
					$image_width 	= 986;
					$image_height 	= 555;
					// Post Thumbnail Wrapper
					echo '<div class="post-thumbnail'.$image_margin.'">';
							mwp_thumb_size($image_size, $image_width, $image_height, 'no-lazy img-responsive' );
							mwp_single_thumbnail_caption();
							mwp_single_pinit();
					echo '</div>';
					// Pinit Script
					if (mwp_option('share-pinit') == 1 ) {
						echo '<script>jQuery(".post-thumbnail .pinit").hide();jQuery(".post-thumbnail img,.post-thumbnail .pinit").hover(function(){jQuery(".pinit").show();},function(){jQuery(".pinit").hide();});jQuery(".pinit").click(function(){var url = jQuery(this).attr("data-curl");var media = jQuery(this).attr("data-cimage");var desc = jQuery(this).attr("data-cdesc");window.open("//www.pinterest.com/pin/create/link/"+"?url="+url+"&media="+media+"&description="+desc,"_blank","top=0,right=0,width=750,height=320");return false;});</script>';
					}
				}
			}
		}
	}
}
/*!
 * Single
 *
 * Thumbnail Caption Helper
 *
*/
function mwp_single_thumbnail_caption() {
	if (mwp_option('single-thumbnail-caption') == 1) :
		global $post;
		$caption = get_post( get_post_thumbnail_id() )->post_excerpt;
		if ( $caption != "" ):
			echo '<div class="caption bg-trans">';
			echo get_post( get_post_thumbnail_id() )->post_excerpt;
			echo '</div>';
		endif;
	endif;
}
/*!
 * Single
 *
 * Pinit button onHover 
 *
*/
function mwp_single_pinit() {
	global $post;
	if (mwp_option('share-pinit') == 1 ) {
		if (mwp_option('shortlink-share') == 1 ) {
			$url = wp_get_shortlink($post->ID);
		} else {
			$url = get_permalink($post->ID);
		}
		?>
		<a class="pinit" title="Pin It" href="#" data-cimage="<?php echo esc_url(mwp_post_thumb_url()); ?>" data-cdesc="<?php echo mwp_escaped_title_space(the_title()); ?>" data-curl="<?php echo esc_url($url); ?>">
			<i class="fa fa-pinterest"></i>
		</a>
		<?php
	}
}
/*
 * Desciption	: Display source post
 * Author 		: Mouad Achemli
 * Source		: http://www.mwordpress.net
 *
*/
function custom_name($postid) {
	
	$article_ids 	= mwp_option('category-article');
	$source_name 	= mwp_option('author_name');
	$name 			= get_post_meta($postid, $source_name , true);
	
	if ( !empty($article_ids) && in_category($article_ids) ) {
		
	} elseif (!empty($name)) { 
		?><div class="post-by"><span><?php echo esc_attr($name); ?></span></div><?php 
	}
	
}
/*
 * Desciption	: Display source post
 * Author 		: Mouad Achemli
 * Source		: http://www.mwordpress.net
 *
*/
function news_source($postid) {
	$source_name 	= mwp_option('source_name');
	$name 			= get_post_meta($postid, $source_name , true);
	$source_link 	= mwp_option('source_link');
	$source 		= get_post_meta($postid, $source_link , true);
	if (!empty($name) && !empty($source)) { 
		?><div class="post-source"><strong><?php _e( 'Source', MWP_TEXT_DOMAIN ); ?></strong><span><a rel="nofollow" target="_blank" href="<?php echo esc_url($source); ?>" title="<?php echo esc_attr($name); ?>" ><?php echo esc_attr($name); ?></a></span></div><?php 
	} elseif (!empty($name) && empty($source)) {
		?><div class="post-source"><strong><?php _e( 'Source', MWP_TEXT_DOMAIN ); ?></strong><span><?php echo esc_attr($name); ?></span></div><?php
	} elseif (empty($name) && !empty($source)) {
		?><div class="post-source"><strong><?php _e( 'Source', MWP_TEXT_DOMAIN ); ?></strong><span><?php echo esc_url($source); ?></span></div><?php
	}
}
/*!
 * Single
 *
 * Content
 *
*/
function mwp_single_content($postid) {
	// News Source
	custom_name($postid);
	// Post Content
	$exclude = mwp_option('readmore-inside-exclude');
	if (mwp_option('readmore-inside') == 0 || !empty($exclude) && in_category($exclude)) { 
		the_content();
	} else {
		$get_custom_btn_text 	= mwp_option('readmore-inside-btn');
		$readmore_inside_text 	= get_post_meta($postid, 'readmore_inside_text' , true);
		if (!empty($readmore_inside_text) && isset($readmore_inside_text)) {
			$custom_btn_text = $readmore_inside_text;
		} elseif (!empty($get_custom_btn_text)) {
			$custom_btn_text = $get_custom_btn_text;
		} else {
			$custom_btn_text = __('Keep reading, Click here', MWP_TEXT_DOMAIN );
		}
		$content = get_post_field( 'post_content', $postid );
		$content_arr = get_extended( $content );
		if( strpos( get_the_content(), '<span id="more-' ) == true ) {
			echo wpautop($content_arr['main']);
			echo '<div class="show-morecontent"><div>'.$custom_btn_text.'</div></div><div class="morecontent" style="display:none;">'. wpautop($content_arr['extended']).'</div>';
			echo '<script>jQuery(document).ready(function($){$(".el-content").on("click", ".show-morecontent", function() {$(".morecontent").show();$(".show-morecontent").hide()});});</script>';
		} else {
			the_content();
		}
	}
	// News Source
	news_source($postid);
}
/*!
 * Single
 *
 * Custom Author Thumbnail
 *
*/
function mwp_authors_info($postid) {
	
	$article_ids 	= mwp_option('category-article');
	$thumb_avatar 	= mwp_option('ac-thumbnail');
	$display_author = mwp_option('ac-name-display');
	
	if (is_rtl()) {
		$align = 'alignright';
	} else {
		$align = 'alignleft';
	}

	if ( !empty($article_ids) && in_category($article_ids) ) {					
		echo '<figure class="wp-caption '.$align.'" style="width:120px;">';
			global $authordata;
			$author_image 	= get_the_author_meta('custom_avatar', get_the_author_meta( 'ID' ));
			$author_name 	= get_the_author_meta('display_name', get_the_author_meta( 'ID' ));
			$meta_image 	= mwp_option('author_photo');
			$print_image 	= get_post_meta($postid, $meta_image, true);
			$meta_name 		= mwp_option('author_name');
			$print_name 	= get_post_meta($postid, $meta_name, true);		
			$img_blank		= 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';
			$type_author 	= mwp_option('ac-name');
			$size			= 100;
			if ($thumb_avatar == 2) {
				// check custom filed or metabox avatar
				if (!empty($print_image) && !empty($print_name)) {	
					$chk_image = parse_url($print_image, PHP_URL_HOST);
					$chk_local = parse_url(get_bloginfo('url'), PHP_URL_HOST);
					if (mwp_option('thumbnail-type') == 8 && $chk_image == $chk_local) {
						$args 	= array(
							'resize' 	=> $size.','.$size,
							'quality' 	=> '100',
							'fit' 		=> ''
						);
						$author_image_output = jetpack_photon_url( $print_image, $args );
					} else {
						$author_image_output = $print_image;
					}
					echo '<img class="img-responsive" alt="' .$print_name. '" src="' .$author_image_output. '" width="'.$size.'" height="'.$size.'" >';
				} 
				// check user profile custom avatar
				elseif (!empty($author_image)) {
					$chk_image = parse_url($author_image, PHP_URL_HOST);
					$chk_local = parse_url(get_bloginfo('url'), PHP_URL_HOST);
					if (mwp_option('thumbnail-type') == 8 && $chk_image == $chk_local) {
						$args 	= array(
							'resize' 	=> $size.','.$size,
							'quality' 	=> '100',
							'fit' 		=> ''
						);
						$author_image_output = jetpack_photon_url( $author_image, $args );
					} else {
						$author_image_output = $author_image;
					}
					echo '<img class="img-responsive" alt="' .$author_name. '" src="' .$author_image_output. '" width="'.$size.'" height="'.$size.'" >';
				} 
				// check WP User Avatar (Plugin)
				elseif (function_exists('get_wp_user_avatar')) { 
					get_wp_user_avatar(get_the_author_meta( 'ID' ), $size); 
				}
				// use default wordpress avatar
				elseif (function_exists('get_avatar')) {
					echo '<img src="'.esc_url( get_avatar_url(get_the_author_meta( 'ID' ), array( 'size' => $size) )).'" alt="'.$author_name.'" />';
				}
			} elseif ($thumb_avatar == 1) {
				mwp_thumb_size('mwp-avatar', $size, $size, 'img-responsive', true );
			}

			if ($display_author == 1) {
				if ($type_author == 2) {
					if (!empty($print_name)) {
						echo '<figcaption class="wp-caption-text">';
							echo $print_name;
						echo '</figcaption>';
					}
				}
			}
		echo '</figure>';
	}
	
}
/*!
 * Single
 *
 * Generate Share Buttons list
 *
*/
function mwp_generate_social_btn($postid, $remove=false) {
	
	$data 		= '';
	$title 		= get_the_title($postid);
	$socials 	= mwp_option('share-buttons-select');
	$wtext 		= mwp_option('share-box-whatsapp');
	
	if (mwp_option('shortlink-share') == 1 ) {
		$url = wp_get_shortlink($postid);
	} else {
		$url = get_permalink($postid);
	}
	
	if (!empty($wtext)) {
		$whatsapp		= $wtext;
		$whatsapp_esc	= mwp_escaped_title_space($wtext);
	} else {
		$whatsapp		= __( 'Have a look at ', MWP_TEXT_DOMAIN );
		$whatsapp_esc	= mwp_escaped_title_space(__( 'Have a look at ', MWP_TEXT_DOMAIN ));
	}
	
	$btext = mwp_escaped_title_space(__( 'I found this article interesting and thought of sharing it with you. Check it out: ', MWP_TEXT_DOMAIN ));

	$onclick = "javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;";
	
	if (!empty($socials)) {
		foreach ($socials as $social => $name) {
			if ($name == 'facebook'):
				$data .= '<li class="facebook"><a title="'. __( 'Share on Facebook', MWP_TEXT_DOMAIN ).'" onclick="'.$onclick.'" href="https://www.facebook.com/share.php?u='.$url.'&t='.mwp_escaped_title_space($title).'"><i class="fa fa-facebook"></i></a></li>';
			endif;
			if ($name == 'twitter'):
				$data .= '<li class="twitter"><a title="'. __( 'Share on Twitter', MWP_TEXT_DOMAIN ).'" href="https://twitter.com/intent/tweet?original_referer='.$url.'&source=tweetbutton&text='.mwp_escaped_title_space($title).'&url='.$url.'"><i class="fa fa-twitter"></i></a></li>';
			endif;
			if ($name == 'email'):
				$data .= '<li class="mail"><a href="mailto:?subject='.mwp_escaped_title_space($title).'&BODY='.$btext.''. $url.'"><i class="fa fa-envelope-o"></i></a></li>';
			endif;
			if ($name == 'whatsapp'):
				$data .= '<li class="whatsapp"><a title="'. __( 'Share on Whatsapp', MWP_TEXT_DOMAIN ).'" href="whatsapp://send?text='.mwp_escaped_title_space($whatsapp).''. $url.'" data-action="share/whatsapp/share"><i class="fa fa-whatsapp"></i></a></li>';
			endif;
			if ($name == 'reddit'):
				$data .= '<li class="reddit"><a title="'. __( 'Share on Reddit', MWP_TEXT_DOMAIN ).'" onclick="'.$onclick.'" href="https://reddit.com/submit?url='.$url.'&title='.mwp_escaped_title_space($title).'"><i class="fa fa-reddit"></i></a></li>';
			endif;
			if ($name == 'digg'):
				$data .= '<li class="digg"><a title="'. __( 'Share on Digg', MWP_TEXT_DOMAIN ).'>" href="http://digg.com/submit?url='.$url.'" onclick="'.$onclick.'"><i class="fa fa-digg"></i></a></li>';
			endif;
		}
		return $data;	
	} else {
		$data .= '<li class="facebook"><a title="'. __( 'Share on Facebook', MWP_TEXT_DOMAIN ).'" onclick="'.$onclick.'" href="https://www.facebook.com/share.php?u='.$url.'&t='.mwp_escaped_title_space($title).'"><i class="fa fa-facebook"></i></a></li>';
		$data .= '<li class="twitter"><a title="'. __( 'Share on Twitter', MWP_TEXT_DOMAIN ).'" href="https://twitter.com/intent/tweet?original_referer='.$url.'&source=tweetbutton&text='.mwp_escaped_title_space($title).'&url='.$url.'"><i class="fa fa-twitter"></i></a></li>';
		$data .= '<li class="mail"><a href="mailto:?subject='.mwp_escaped_title_space($title).'&BODY='.$btext.''. $url.'"><i class="fa fa-envelope-o"></i></a></li>';
		$data .= '<li class="whatsapp"><a title="'. __( 'Share on Whatsapp', MWP_TEXT_DOMAIN ).'" href="whatsapp://send?text='.mwp_escaped_title_space($whatsapp).''. $url.'" data-action="share/whatsapp/share"><i class="fa fa-whatsapp"></i></a></li>';
		$data .= '<li class="reddit"><a title="'. __( 'Share on Reddit', MWP_TEXT_DOMAIN ).'" onclick="'.$onclick.'" href="https://reddit.com/submit?url='.$url.'&title='.mwp_escaped_title_space($title).'"><i class="fa fa-reddit"></i></a></li>';
		$data .= '<li class="digg"><a title="'. __( 'Share on Digg', MWP_TEXT_DOMAIN ).'>" href="http://digg.com/submit?url='.$url.'" onclick="'.$onclick.'"><i class="fa fa-digg"></i></a></li>';
	}
	return $data;
}
/*!
 * Single
 *
 * Share Buttons
 *
*/
function mwp_single_buttons($postid) {
	
	if (mwp_option('mobile-single-share-button') == 1) :
	?>
	<div class="share">
		<div class="share-right">
			<ul class="share-post">
				<?php echo mwp_generate_social_btn($postid); ?>
			</ul>
		</div>
	</div>
	<?php
	endif;
}

/*!
 * Single
 *
 * Share Buttons (Out Container)
 *
*/
function mwp_single_share() {
	
	$queried_object = get_queried_object();
	
	if (is_singular()) :
	
		$share_title = get_the_title($queried_object->ID);
		$title = get_the_title($queried_object->ID);
		
		if (mwp_option('shortlink-share') == 1 ) {
			$url = wp_get_shortlink($queried_object->ID);
		} else {
			$url = get_permalink($queried_object->ID);
		}
		
		$btext = mwp_escaped_title_space(__( 'I found this article interesting and thought of sharing it with you. Check it out: ', MWP_TEXT_DOMAIN ));
		
		$wtext = mwp_option('share-box-whatsapp');
		if (!empty($wtext)) {
			$whatsapp		= $wtext;
			$whatsapp_esc	= mwp_escaped_title_space($wtext);
		} else {
			$whatsapp		= __( 'Have a look at ', MWP_TEXT_DOMAIN );
			$whatsapp_esc	= mwp_escaped_title_space(__( 'Have a look at ', MWP_TEXT_DOMAIN ));
		}
		
		if (mwp_option('share-fixed-screen') == 1 && is_singular() ) :
		?>
		<div class="share-box">
			<ul>
				<?php echo mwp_generate_social_btn(get_the_ID() , 'print'); ?>
			</ul>
		</div>
		<?php
		endif;
	endif;
}

/*!
 * Single
 *
 * Tags
 *
*/
function mwp_single_tags() {
	if (mwp_option('mobile-single-tags') == 1) :
		the_tags('<div class="tags"><span>'. __( 'Tagged ', MWP_TEXT_DOMAIN ) . '</span>', ' ', '</div>'); 
	endif;
}
/*!
 * Single
 *
 * Post Shortlink
 *
*/
function mwp_single_shortlink($postid) {
	if (mwp_option('mobile-single-shortlink') == 1) :
		if (function_exists('wp_get_shortlink')) { 
			?><div class="post-shortlink"><?php esc_html_e( 'Short Link ', MWP_TEXT_DOMAIN ); ?>
				<label class="meta-hidden" for="post_shortlink"><?php esc_html_e( 'Short Link ', MWP_TEXT_DOMAIN ); ?></label>
				<input id="post_shortlink" type="text" aria-labelledby="post_shortlink" onclick="this.focus(); this.select();" value="<?php echo wp_get_shortlink($postid); ?>">
			</div><?php
		} 
	endif;
	if (function_exists('wp_get_shortlink')) { 
		echo '<p class="print-source-link"><strong>'. esc_html__( 'Source', MWP_TEXT_DOMAIN ) .'</strong> : '.wp_get_shortlink($postid).'</p>';
	}
}
/*!
 * Single
 *
 * Next and Prev links
 *
*/
function mwp_single_links() {
	if (mwp_option('mobile-single-next-prev') == 1) :
		?>
		<div class="post-nav">
			<ul>
				<li class="post-prev">
				<?php
				$prev_post = get_previous_post(true);
				if (!empty( $prev_post )): ?>
				<a href="<?php echo get_permalink( $prev_post->ID ); ?>" rel="prev">
					<span><?php esc_html_e( 'Previous', MWP_TEXT_DOMAIN ); ?></span>
					<?php echo $prev_post->post_title; ?>
				</a>
				<?php endif; ?>
				</li>
				<li class="post-next">
				<?php
				$next_post = get_next_post(true);
				if (!empty( $next_post )): ?>
				<a href="<?php echo get_permalink( $next_post->ID ); ?>" rel="next">
					<span><?php esc_html_e( 'Next', MWP_TEXT_DOMAIN ); ?></span>
					<?php echo $next_post->post_title; ?>
				</a>
				<?php endif; ?>
				</li>
			</ul>
		</div>
		<?php 
	endif;
}
/*!
 * Single
 *
 * Author Bio
 *
*/
function mwp_single_author_bio($authordata) {
	if (mwp_option('mobile-single-author-info') == 1) :
		$facebook 	= get_the_author_meta('facebook', get_the_author_meta( 'ID'));
		$twitter 	= get_the_author_meta('twitter', get_the_author_meta( 'ID'));
		?>
		<div class="author-bio">
			<div class="author-img">
				<?php
				$author_image 	= get_the_author_meta('custom_avatar', get_the_author_meta( 'ID' ));
				$author_name 	= esc_attr(get_the_author_meta('display_name', get_the_author_meta( 'ID' )));	
				$size 			= 60;
				$img_blank		= 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';
				echo '<a href="'.get_author_posts_url( get_the_author_meta( 'ID' ) ).'" title="'.$author_name.'">';
				if (!empty($author_image) && !empty($author_name)) {
					if (mwp_option('lazyload-mobile') == 1) {
						echo '<img class="img-responsive" src="'.$img_blank.'" data-src="' .esc_url($author_image). '" alt="' .$author_name. '" width="'.$size.'" height="'.$size.'" >';
					} else {
						echo '<img class="img-responsive" alt="' .$author_name. '" src="' .esc_url($author_image). '" width="'.$size.'" height="'.$size.'" >';
					}
				} elseif (function_exists('get_wp_user_avatar')) {
					echo get_wp_user_avatar(get_the_author_meta( 'ID' ), 60);
				} else {
					if (mwp_option('lazyload-mobile') == 1) {
						echo '<img class="lazy img-responsive" alt="' .$author_name. '" src="'.$img_blank.'" data-src="' .esc_url( get_avatar_url(get_the_author_meta( 'ID' ), array( 'size' => $size) )). '" width="'.$size.'" height="'.$size.'">';
					} else {
						echo '<img src="'.esc_url( get_avatar_url(get_the_author_meta( 'ID' ), array( 'size' => $size) )).'" alt="'.$author_name.'" />';
					}
				}
				echo '</a>';
				?>
			</div>
			<div class="title">
				<?php mwp_posted_by_2(); ?>
			</div>
			<p><?php echo get_the_author_meta( 'description', get_the_author_meta( 'ID') ); ?></p>
			<ul class="author-links">
				<li class="facebook"><a title="<?php esc_html_e( 'Facebook', MWP_TEXT_DOMAIN ); ?>" href="<?php echo esc_url($facebook); ?>" rel="noopener"><i class="fa fa-facebook"></i></a></li>
				<li class="twitter"><a title="<?php esc_html_e( 'Twitter', MWP_TEXT_DOMAIN ); ?>" href="<?php echo esc_url($twitter); ?>" rel="noopener"><i class="fa fa-twitter"></i></a></li>
			</ul>
		</div>
		<?php
	endif;
}
function mwp_archive_author_bio($template_author_obj) {
	?>
	<div class="author-bio">
		<div class="author-img">
		<?php
			$author_image 	= esc_url(get_the_author_meta('custom_avatar', $template_author_obj->ID ));
			$author_name 	= esc_attr(get_the_author_meta('display_name', $template_author_obj->ID ));	
			if (!empty($author_image) && !empty($author_name)) {
				?>
				<a href="<?php echo get_author_posts_url($template_author_obj->ID ); ?>" title="<?php echo $author_name; ?>">
					<img src="<?php echo $author_image; ?>" width="60" height="60" alt="<?php esc_html_e( 'Author Thumbnail', MWP_TEXT_DOMAIN ); ?>">
				</a>
				<?php
			} elseif (function_exists('get_wp_user_avatar')) {
				echo get_wp_user_avatar($template_author_obj->ID, '60');
			} else {
				?><img src="<?php echo esc_url( get_avatar_url($template_author_obj->user_email, array( 'size' => 60) )); ?>" alt="<?php echo $author_name; ?>" /><?php
			}
		?>
		</div>
		<div class="title">
			<?php the_author_link(); ?>
		</div>	
		<p><?php echo get_the_author_meta( 'description', $template_author_obj->ID ); ?></p>
			
		<ul class="author-links">
			<li class="facebook"><a title="<?php esc_html_e( 'Facebook', MWP_TEXT_DOMAIN ); ?>" href="<?php echo esc_url($template_author_obj->facebook); ?>" rel="noopener"><i class="fa fa-facebook"></i></a></li>
			<li class="twitter"><a title="<?php esc_html_e( 'Twitter', MWP_TEXT_DOMAIN ); ?>" href="<?php echo esc_url($template_author_obj->twitter); ?>" rel="noopener"><i class="fa fa-twitter"></i></a></li>
		</ul>
	</div>
	<?php
}
/*!
 * Single
 *
 * Add Title to post content
 *
*/
function mwp_single_vid() {
	$videos_ids 		= mwp_option('category-videos');
	if (!empty($videos_ids) && in_category($videos_ids) ) :
		echo '<div class="meta-hidden">'.get_the_title().'</div>';
	endif;
}
/*!
 * Single
 *
 * Phone Specs
 *
*/
function mwp_single_phone_info($postid) {
	$check 		= get_post_meta($postid, 'phone_info' , true);
	$cpu 		= get_post_meta($postid, 'phone_info_cpu' , true);
	$ram 		= get_post_meta($postid, 'phone_info_ram' , true);
	$storage 	= get_post_meta($postid, 'phone_info_storage' , true);
	$display 	= get_post_meta($postid, 'phone_info_display' , true);
	$camera		= get_post_meta($postid, 'phone_info_camera' , true);
	$os			= get_post_meta($postid, 'phone_info_os' , true);
	$battery	= get_post_meta($postid, 'phone_info_battery' , true);

	if ($check == 'on') {
		?>
		<div class="phone-data">
			<div class="phone-thumbnail">
				<?php mwp_thumb_size('mwp-book', 486, 486, 'img-responsive'); ?>
			</div>
			<div class="phone-info">
				<ul>
					<li title="<?php esc_html_e($cpu); ?>">
						<div class="phone-info-anim">
							<i class="fa fa-microchip" aria-hidden="true"></i>
							<div class="phone-info-content">
								<strong><?php esc_html_e( 'CPU', MWP_TEXT_DOMAIN ); ?></strong>: <span><?php esc_html_e($cpu); ?></span>
							</div>
						</div>
					</li>
					<li title="<?php esc_html_e($ram); ?>">
						<div class="phone-info-anim">
							<i class="fa fa-tasks" aria-hidden="true"></i>
							<div class="phone-info-content">
								<strong><?php esc_html_e( 'RAM', MWP_TEXT_DOMAIN ); ?></strong>: <span><?php esc_html_e($ram); ?></span>
							</div>
						</div>
					</li>
					<li title="<?php esc_html_e($storage); ?>">
						<div class="phone-info-anim">
							<i class="fa fa-hdd-o" aria-hidden="true"></i>
							<div class="phone-info-content">
								<strong><?php esc_html_e( 'Storage', MWP_TEXT_DOMAIN ); ?></strong>: <span><?php esc_html_e($storage); ?></span>
							</div>
						</div>
					</li>
					<li title="<?php esc_html_e($display); ?>">
						<div class="phone-info-anim">
							<i class="fa fa-television" aria-hidden="true"></i>
							<div class="phone-info-content">
								<strong><?php esc_html_e( 'Display', MWP_TEXT_DOMAIN ); ?></strong>: <span><?php esc_html_e($display); ?></span>
							</div>
						</div>
					</li>
					<li title="<?php esc_html_e($camera); ?>">
						<div class="phone-info-anim">
							<i class="fa fa-camera" aria-hidden="true"></i>
							<div class="phone-info-content">
								<strong><?php esc_html_e( 'Camera', MWP_TEXT_DOMAIN ); ?></strong>: <span><?php esc_html_e($camera); ?></span>
							</div>
						</div>
					</li>
					<li title="<?php esc_html_e($os); ?>">
						<div class="phone-info-anim">
							<i class="fa fa-cog" aria-hidden="true"></i>
							<div class="phone-info-content">
								<strong><?php esc_html_e( 'OS', MWP_TEXT_DOMAIN ); ?></strong>: <span><?php esc_html_e($os); ?></span>
							</div>
						</div>
					</li>
					<li title="<?php esc_html_e($battery); ?>">
						<div class="phone-info-anim">
							<i class="fa fa-battery-full" aria-hidden="true"></i>
							<div class="phone-info-content">
								<strong><?php esc_html_e( 'Battery', MWP_TEXT_DOMAIN ); ?></strong>: <span><?php esc_html_e($battery); ?></span>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
		<?php
	}
}
/*!
 * Single
 *
 * Gallery
 *
*/
function mwp_single_gallery($postid) {
	$get_categories_ids = mwp_option('category-gallery');
	if (in_category($get_categories_ids, $postid)) {
		?>
		<div class="entry-gallery" itemscope itemtype="http://schema.org/ImageGallery">
			<ul class="gallery-content">
				<?php
				if (mwp_option('lightbox-library') == 1) {
					$classLink = 'swipebox';
					$dataLink = '';
				} elseif (mwp_option('lightbox-library') == 2) {
					$classLink = '';
					$dataLink = " data-lightbox='roadtrip' data-group='group'";
				} elseif (mwp_option('lightbox-library') == 3) {
					$classLink = 'venobox';
					$dataLink = " data-gall='myGallery'";
				}
				$attachments = get_children(array(
					'post_parent' => $postid,
					'post_status' => 'inherit',
					'post_type' => 'attachment',
					'post_mime_type' => 'image',
					'order' => 'ASC',
					'orderby' => 'menu_order ID')
				);
				foreach($attachments as $att_id => $attachment) {
					$thumbnails = wp_get_attachment_image_src($attachment->ID, 'full');
					$thumbnails2 = wp_get_attachment_image_src($attachment->ID, 'mwp_thumb_x10');
					$full_img_url = wp_get_attachment_url($attachment->ID);
					$split_pos = strpos($full_img_url, 'wp-content');
					$split_len = (strlen($full_img_url) - $split_pos);
					$abs_img_url = substr($full_img_url, $split_pos, $split_len);
					$full_info = @getimagesize(ABSPATH.$abs_img_url);
					?>	
					<li itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject" >
						<a itemprop="contentUrl" <?php echo $dataLink; ?> class="<?php echo esc_attr($classLink); ?>" href="<?php echo esc_url($full_img_url); ?>" title="<?php echo $attachment->post_title; ?>">							
							<img itemprop="thumbnail" src="<?php echo singel_gallery_helper($thumbnails[0], 900 , 506, $thumbnails2[0]); ?>"  alt="<?php echo $attachment->post_title; ?>" />
						</a>
					</li>
					<?php
				}
				?>
			</ul>
			<a href="#" class="prev"><i class="fa fa-chevron-right"></i></a>
			<a href="#" class="next"><i class="fa fa-chevron-left"></i></a>
			<script>
				jQuery(document).ready(function(){
					jQuery('<div class="cycle-overlay sg-overlay bg-trans"></div>').appendTo('ul.gallery-content');
					jQuery('.gallery-content').each(function(){
						var p = this.parentNode;
						jQuery(this).cycle({
							timeout:0,
							slides:'li',
							fx:'scrollHorz',
							pauseOnHover:true,
							pager:false,
							overlayTemplate:'<span>{{slideNum}} / {{slideCount}}</span>',
							prev:jQuery('.prev', p),
							next:jQuery('.next', p),
							log:false
						});    
					});
				});
			</script>
		</div>
		<?php
	}
}
/*!
 * Single
 *
 * Gallery : Thumbnail Helper
 *
*/
function singel_gallery_helper($thumbnails ,$width, $height, $attachment) {
	$params = array( 
		'width' 	=> $width, 
		'height' 	=> $height, 
		'crop' 		=> null, 
		'quality' 	=> 100  
	);	
	if ( 
		mwp_option('thumbnail-type') == 1 || 
		mwp_option('thumbnail-type') == 2 || 
		mwp_option('thumbnail-type') == 3 || 
		mwp_option('thumbnail-type') == 4 ||
		mwp_option('thumbnail-type') == 5 
		) 
	{
		$image = bfi_thumb( $thumbnails, $params );
		$image_print = $image;
	} 
	elseif (mwp_option('thumbnail-type') == 6) {
		$image = get_template_directory_uri() .'/resize.php?src='.$thumbnails.'&amp;w='.$width.'&amp;h='.$height.'&amp;zc=0&amp;s=1&amp;q=100';
		$image_print = $image;
	} 
	elseif (mwp_option('thumbnail-type') == 7) {
		$image = home_url().'/media/resizer/'.$width.'x'.$height.'/r/'.remove_http($thumbnails);
		$image_print = $image;
	}
	elseif (mwp_option('thumbnail-type') == 8) {
		$args = array(
			'resize' 	=> $width.','.$height,
			'quality'   => '100',
			'fit'	=> '',
		);
		$image = jetpack_photon_url( $thumbnails, $args );
		$image_print = $image;
	} 
	elseif (mwp_option('thumbnail-type') == 9) {
		$image_print = $attachment;
	}
	return esc_url($image_print);
}
/*!
 * Single
 *
 * Gallery Optional
 *
*/
function mwp_optional_gallery($postid) {
	?>
	<div class="entry-gallery" itemscope itemtype="http://schema.org/ImageGallery">
		<ul class="gallery-content">
			<?php
			if (mwp_option('lightbox-library') == '1') {
				$classLink = 'swipebox';
			} elseif (mwp_option('lightbox-library') == '2') {
				$classLink = '';
			} elseif (mwp_option('lightbox-library') == '3') {
				$classLink = 'venobox';
			}
			$attachments = get_children(array(
				'post_parent' => $postid,
				'post_status' => 'inherit',
				'post_type' => 'attachment',
				'post_mime_type' => 'image',
				'order' => 'ASC',
				'orderby' => 'menu_order ID')
			);
			foreach($attachments as $att_id => $attachment) {
				$thumbnails = wp_get_attachment_image_src($attachment->ID, 'full');
				$thumbnails2 = wp_get_attachment_image_src($attachment->ID, 'mwp-single');
				$full_img_url = wp_get_attachment_url($attachment->ID);
				$split_pos = strpos($full_img_url, 'wp-content');
				$split_len = (strlen($full_img_url) - $split_pos);
				$abs_img_url = substr($full_img_url, $split_pos, $split_len);
				$full_info = @getimagesize(ABSPATH.$abs_img_url);
				?>	
				<li itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject" >
					<a itemprop="contentUrl" class="<?php echo esc_attr($classLink); ?>" href="<?php echo esc_url($full_img_url); ?>" title="<?php echo esc_attr($attachment->post_title); ?>">							
						<img itemprop="thumbnail" src="<?php echo singel_gallery_helper($thumbnails[0], 900 , 506, $thumbnails2[0]); ?>" alt="<?php echo esc_attr($attachment->post_title); ?>" />
					</a>
				</li>
				<?php
			}
			?>
		</ul>
		<a href="#" class="prev"><i class="fa fa-chevron-right"></i></a>
		<a href="#" class="next"><i class="fa fa-chevron-left"></i></a>
		<script>
			jQuery(document).ready(function(){
				jQuery('<div class="cycle-overlay sg-overlay bg-trans"></div>').appendTo('ul.gallery-content');
				jQuery('.gallery-content').each(function(){
					var p = this.parentNode;
					jQuery(this).cycle({
						timeout:0,
						slides:'li',
						fx:'scrollHorz',
						pauseOnHover:true,
						pager:false,
						overlayTemplate:'<span>{{slideNum}} / {{slideCount}}</span>',
						prev:jQuery('.prev', p),
						next:jQuery('.next', p),
						log:false
					});    
				});
			});
		</script>
	</div>
	<?php
}
/*!
 * Single
 *
 * Comments
 *
*/
function mwp_single_comments($postid) {
	if (mwp_option('mobile-single-comments') == 1 ){
		echo '<div class="comments-shadow">';
		if (mwp_option('single-comments-type') == 1 || mwp_option('single-comments-type') == 2) {
			comments_template();
		} elseif (mwp_option('single-comments-type') == 3) {
			
			echo '<div class="comments">  
				<div class="fb-comments-wrap">
					<div class="fb-comments" data-href="'.get_permalink($postid).'" data-width="100%" data-numposts="10" data-colorscheme="light"></div>
				</div>
			</div>';
			
		} elseif (mwp_option('single-comments-type') == 4) {
			echo '<div class="disqus-wrap">
					<div id="disqus_thread"></div>
				</div>';
		}
		echo '<div class="clearfix"></div></div>';
	}
}

/*!
 * Single
 *
 * Post Pagination
 *
*/
function mwp_wp_link_pages() {

	$get_page_links_icons = mwp_option('page-links-fa-icon');
	if ($get_page_links_icons == 1 ) {
		if (is_rtl()) {
			$page_links_icons_right = 'fa-long-arrow-right';
			$page_links_icons_left = 'fa-long-arrow-left';
		} else {
			$page_links_icons_right = 'fa-long-arrow-left';
			$page_links_icons_left = 'fa-long-arrow-right';
		}
	} elseif ($get_page_links_icons == 2 ) {
		if (is_rtl()) {
			$page_links_icons_right = 'fa-arrow-circle-o-right';
			$page_links_icons_left = 'fa-arrow-circle-o-left';
		} else {
			$page_links_icons_right = 'fa-arrow-circle-o-left';
			$page_links_icons_left = 'fa-arrow-circle-o-right';
		}
	} elseif ($get_page_links_icons == 3 ) {
		if (is_rtl()) {
			$page_links_icons_right = 'fa-arrow-right';
			$page_links_icons_left = 'fa-arrow-left';
		} else {
			$page_links_icons_right = 'fa-arrow-left';
			$page_links_icons_left = 'fa-arrow-right';
		}
	} elseif ($get_page_links_icons == 4 ) {
		if (is_rtl()) {
			$page_links_icons_right = 'fa-arrow-circle-right';
			$page_links_icons_left = 'fa-arrow-circle-left';
		} else {
			$page_links_icons_right = 'fa-arrow-circle-left';
			$page_links_icons_left = 'fa-arrow-circle-right';
		}
	} elseif ($get_page_links_icons == 5 ) {
		if (is_rtl()) {
			$page_links_icons_right = 'fa-caret-right';
			$page_links_icons_left = 'fa-caret-left';
		} else {
			$page_links_icons_right = 'fa-caret-left';
			$page_links_icons_left = 'fa-caret-right';
		}
	} elseif ($get_page_links_icons == 6 ) {
		if (is_rtl()) {
			$page_links_icons_right = 'fa-angle-right';
			$page_links_icons_left = 'fa-angle-left';
		} else {
			$page_links_icons_right = 'fa-angle-left';
			$page_links_icons_left = 'fa-angle-right';
		}
	} elseif ($get_page_links_icons == 7 ) {
		if (is_rtl()) {
			$page_links_icons_right = 'fa-chevron-right';
			$page_links_icons_left = 'fa-chevron-left';
		} else {
			$page_links_icons_right = 'fa-chevron-left';
			$page_links_icons_left = 'fa-chevron-right';
		}
	} elseif ($get_page_links_icons == 8 ) {
		if (is_rtl()) {
			$page_links_icons_right = 'fa-chevron-circle-right';
			$page_links_icons_left = 'fa-chevron-circle-left';
		} else {
			$page_links_icons_right = 'fa-chevron-circle-left';
			$page_links_icons_left = 'fa-chevron-circle-right';
		}
	} elseif ($get_page_links_icons == 9 ) {
		if (is_rtl()) {
			$page_links_icons_right = 'fa-forward';
			$page_links_icons_left = 'fa-backward';
		} else {
			$page_links_icons_right = 'fa-backward';
			$page_links_icons_left = 'fa-forward';
		}
	} elseif ($get_page_links_icons == 10 ) {
		if (is_rtl()) {
			$page_links_icons_right = 'fa-angle-double-right';
			$page_links_icons_left = 'fa-angle-double-left';
		} else {
			$page_links_icons_right = 'fa-angle-double-left';
			$page_links_icons_left = 'fa-angle-double-right';
		}
	} elseif ($get_page_links_icons == 11 ) {
		if (is_rtl()) {
			$page_links_icons_right = 'fa-hand-o-right';
			$page_links_icons_left = 'fa-hand-o-left';
		} else {
			$page_links_icons_right = 'fa-hand-o-left';
			$page_links_icons_left = 'fa-hand-o-right';
		}
	}
	
	$bs_button_color 	= mwp_option('page-links-bs-btn');
	
	$get_bs_button_size = mwp_option('page-links-bs-size');
	if ($get_bs_button_size == 1) {
		$bs_button_size = 'btn-xs ';
	} elseif ($get_bs_button_size == 2) {
		$bs_button_size = '';
	} elseif ($get_bs_button_size == 3) {
		$bs_button_size = 'btn-lg ';
	}

	$get_nextpagelink = mwp_option('page-links-text-cn');	
	if (!empty($get_nextpagelink)) {
		$nextpagelink = $get_nextpagelink;
	} else {
		$nextpagelink = __( 'Next page' );
	}
	
	$get_previouspagelink = mwp_option('page-links-text-cp');
	if (!empty($get_previouspagelink)) {
		$previouspagelink = $get_previouspagelink;
	} else {
		$previouspagelink = __( 'Previous page' );
	}
	
	$next_page_icon = '<i class="fa '.$page_links_icons_left.'" aria-hidden="true"></i>';
	$prev_page_icon = '<i class="fa '.$page_links_icons_right.'" aria-hidden="true"></i>';

	$extra_space = "&nbsp;";
	$get_page_links_style 	= mwp_option('page-links-it');
	if ($get_page_links_style == 1) {
		$do_nextpagelink 		= $nextpagelink;
		$do_previouspagelink 	= $previouspagelink;
		$do_link_before			= '';
		$do_link_after			= '';
		$link_class				= ' pagination-text-size pagination-icon-size';
		$color_class			= ' pagination-it-color';
	} elseif ($get_page_links_style == 2) {
		$do_nextpagelink 		= $nextpagelink;
		$do_previouspagelink 	= $previouspagelink;
		$do_link_before			= '<div class="btn '.$bs_button_size.'btn-'.$bs_button_color.'">';
		$do_link_after			= '</div>';
		$link_class				= '';
		$color_class			= '';
	} elseif ($get_page_links_style == 3) {
		$do_nextpagelink 		= $nextpagelink.$extra_space.$next_page_icon;
		$do_previouspagelink 	= $prev_page_icon.$extra_space.$previouspagelink;
		$do_link_before			= '<div class="btn '.$bs_button_size.'btn-'.$bs_button_color.'">';
		$do_link_after			= '</div>';
		$link_class				= '';
		$color_class			= '';
	} elseif ($get_page_links_style == 4) {
		$do_nextpagelink 		= $nextpagelink.$extra_space.$next_page_icon;
		$do_previouspagelink 	= $prev_page_icon.$extra_space.$previouspagelink;
		$do_link_before			= '';
		$do_link_after			= '';
		$link_class				= ' pagination-text-size pagination-icon-size';
		$color_class			= ' pagination-it-color';
	} elseif ($get_page_links_style == 5) {
		$do_nextpagelink 		= $next_page_icon;
		$do_previouspagelink 	= $prev_page_icon;
		$do_link_before			= '';
		$do_link_after			= '';
		$link_class				= ' pagination-text-size pagination-icon-size';
		$color_class			= ' pagination-it-color';
	} elseif ($get_page_links_style == 6) {
		$do_nextpagelink 		= $next_page_icon;
		$do_previouspagelink 	= $prev_page_icon;
		$do_link_before			= '<div class="btn '.$bs_button_size.'btn-'.$bs_button_color.'">';
		$do_link_after			= '</div>';
		$link_class				= ' pagination-icon-size';
		$color_class			= '';
	}
	
	$get_page_links_align = mwp_option('page-links-align');
	if ($get_page_links_align == 1) {
		$do_before 	= '<div class="block-div pagination-text'.$link_class.$color_class.'"><div class="centered centered-margin">';
		$do_after	= '<div class="clearfix"></div></div></div>';
		if ($get_page_links_style == 5) {
			$do_separator = '<span class="sep">|</span>';
		} else {
			$do_separator = ' ';
		}
	} elseif ($get_page_links_align == 2) {
		$do_before 	= '<div class="pagination-links pagination-text-size pagination-icon-size'.$color_class.'">';
		$do_after	= '<div class="clearfix"></div></div>';
		$do_separator	= ' ';
	}
	
	if (mwp_option('page-links') == 2) {
		$param = array(
			'before'           => $do_before,
			'after'            => $do_after,
			'link_before'      => $do_link_before,
			'link_after'       => $do_link_after,
			'next_or_number'   => 'next',
			'separator'        => $do_separator,
			'nextpagelink'     => $do_nextpagelink,
			'previouspagelink' => $do_previouspagelink,
			'pagelink'         => '%',
			'echo'             => 1
		);
	} else {
		$param = array(
			'before'           => '<div class="pagination"><span class="pages">' . __( 'Pages:' ).'</span>',
			'after'            => '</div>',
			'link_before'      => '',
			'link_after'       => '',
			'next_or_number'   => 'number',
			'separator'        => ' ',
			'nextpagelink'     => __( 'Next page' ),
			'previouspagelink' => __( 'Previous page' ),
			'pagelink'         => '%',
			'echo'             => 1
		);
	}
	wp_link_pages($param);
}

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists