Sindbad~EG File Manager
<?php
/**
* Get Current page object
**/
if(!is_null($post))
{
$page_obj = get_page($post->ID);
}
$current_page_id = '';
/**
* Get current page id
**/
if(!is_null($post) && isset($page_obj->ID))
{
$current_page_id = $page_obj->ID;
}
//Get Page Menu Transparent Option
$page_menu_transparent = get_post_meta($current_page_id, 'page_menu_transparent', true);
//Get Boxed Layout Option
$page_boxed_layout = get_post_meta($current_page_id, 'page_boxed_layout', true);
//Get page header display setting
$page_title = get_the_title();
$page_show_title = get_post_meta($current_page_id, 'page_show_title', true);
if(is_tag())
{
$page_show_title = 0;
$page_title = single_cat_title( '', false );
$page_title = ucfirst($page_title);
$term = 'tag';
}
elseif(is_category())
{
$page_show_title = 0;
$page_title = single_cat_title( '', false );
$term = 'category';
}
elseif(is_archive())
{
$page_show_title = 0;
if ( is_day() ) :
$page_title = get_the_date();
elseif ( is_month() ) :
$page_title = get_the_date('F Y');
elseif ( is_year() ) :
$page_title = get_the_date('Y');
elseif ( !empty($term) ) :
$obj_term = get_term_by('slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
$page_taxonomy = get_taxonomy($obj_term->taxonomy);
$page_title = $obj_term->name;
else :
$page_title = esc_html__('Blog Archives', 'coursector');
endif;
$term = 'archive';
//Check if LearnPress page
$learn_press_courses_page_id = get_option('learn_press_courses_page_id');
$current_page_id = get_queried_object_id();
if($learn_press_courses_page_id == $current_page_id)
{
$page_show_title = get_post_meta($current_page_id, 'page_show_title', true);
$page_title = get_the_title($current_page_id);
$page_tagline = get_the_excerpt($current_page_id);
}
}
else if(is_search())
{
$page_show_title = 0;
$page_title = esc_html__('Search', 'coursector' );
$term = 'search';
//Hide page title if doesn't have any results
if(!have_posts())
{
$page_show_title = 1;
}
}
else if(is_home())
{
$page_show_title = 0;
$page_title = esc_html__('Blog', 'coursector' );
$term = 'home';
}
$coursector_page_content_class = coursector_get_page_content_class();
$coursector_hide_title = coursector_get_hide_title();
if($coursector_hide_title == 1)
{
$page_show_title = 1;
}
$coursector_screen_class = coursector_get_screen_class();
if($coursector_screen_class == 'split' OR $coursector_screen_class == 'single_client')
{
$page_show_title = 0;
}
if($coursector_screen_class == 'single_client')
{
$page_show_title = 1;
}
if(isset($_GET['elementor_library']) && !empty($_GET['elementor_library']))
{
$page_show_title = 1;
}
if(is_single() && $post->post_type == 'lp_course')
{
$page_show_title = 1;
}
if(empty($page_show_title))
{
//Get current page tagline
$page_tagline = get_post_meta($current_page_id, 'page_tagline', true);
if(is_category())
{
$page_tagline = category_description();
}
if(is_tag())
{
$page_tagline = category_description();
}
if(is_archive() && !is_category() && !is_tag() && empty($term))
{
$page_tagline = esc_html__('Archive posts in ', 'coursector' );
if ( is_day() ) :
$page_tagline.= get_the_date();
elseif ( is_month() ) :
$page_tagline.= get_the_date('F Y');
elseif ( is_year() ) :
$page_tagline.= get_the_date('Y');
endif;
}
//If on gallery post type page
if(is_single() && $post->post_type == 'galleries')
{
$page_tagline = get_the_excerpt();
}
if(is_search())
{
$page_tagline = esc_html__('Search Results for ', 'coursector' ).get_search_query();
}
if(!empty($term) && !is_tag())
{
$ob_term = get_term_by('slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
if(isset($ob_term->description))
{
$page_tagline = $ob_term->description;
}
}
$pp_page_bg = '';
//Get page featured image
if(has_post_thumbnail($current_page_id, 'full') && empty($term))
{
$image_id = get_post_thumbnail_id($current_page_id);
$image_thumb = wp_get_attachment_image_src($image_id, 'full', true);
if(isset($image_thumb[0]) && !empty($image_thumb[0]))
{
$pp_page_bg = $image_thumb[0];
}
//Check if add parallax effect
$tg_page_header_bg_parallax = get_theme_mod('tg_page_header_bg_parallax');
if(!empty($tg_page_header_bg_parallax))
{
wp_enqueue_script("jarallax", get_template_directory_uri()."/js/jarallax.js", false, COURSECTOR_THEMEVERSION, true);
wp_enqueue_script("jarallax-video", get_template_directory_uri()."/js/jarallax-video.js", false, COURSECTOR_THEMEVERSION, true);
wp_enqueue_script("jarallax-element", get_template_directory_uri()."/js/jarallax-element.js", false, COURSECTOR_THEMEVERSION, true);
$custom_jarallax_script = "
jQuery(function( $ ) {
var parallaxSpeed = 0.2;
if(jQuery(window).width() > 1200)
{
parallaxSpeed = 0.5;
}
var ua = window.navigator.userAgent;
var msie = ua.indexOf('MSIE ');
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./) || jQuery(this).width() < 768)
{
jQuery('.parallax').each(function(){
var dataImgURL = jQuery(this).data('image');
if(jQuery.type(dataImgURL) != 'undefined')
{
jQuery(this).css('background-image', 'url('+dataImgURL+')');
jQuery(this).css('background-size', 'cover');
jQuery(this).css('background-position', 'center center');
}
});
}
else
{
var parallaxSpeed = 0.5;
if(jQuery(window).width() > 1200)
{
parallaxSpeed = 0.7;
}
jQuery('.parallax').each(function(){
var parallaxObj = jQuery(this);
jQuery(this).jarallax({
zIndex : 0,
speed : parallaxSpeed,
onCoverImage: function() {
parallaxObj.css('z-index', 0);
}
});
});
}
});
";
wp_add_inline_script('jarallax-element', $custom_jarallax_script);
}
}
$coursector_topbar = coursector_get_topbar();
$page_header_type = '';
if(is_page())
{
if(COURSECTOR_THEMEDEMO)
{
$page_title_split_arr = explode(' ', $page_title);
if(isset($page_title_split_arr[0]) && $page_title_split_arr[0] == 'Blog')
{
$page_title = 'Blog';
}
}
//Get header featured content
$page_header_type = get_post_meta(get_the_ID(), 'page_header_type', true);
$video_url = '';
if($page_header_type == 'Youtube Video' OR $page_header_type == 'Vimeo Video')
{
//Add jarallax video script
wp_enqueue_script("jarallax-video", get_template_directory_uri()."/js/jarallax-video.js", false, COURSECTOR_THEMEVERSION, true);
if($page_header_type == 'Youtube Video')
{
$page_header_youtube = get_post_meta(get_the_ID(), 'page_header_youtube', true);
$video_url = 'https://www.youtube.com/watch?v='.$page_header_youtube;
}
else
{
$page_header_vimeo = get_post_meta(get_the_ID(), 'page_header_vimeo', true);
$video_url = 'https://vimeo.com/'.$page_header_vimeo;
}
}
}
?>
<div id="page_caption" class="<?php if(!empty($pp_page_bg) OR $page_header_type == 'Youtube Video' OR $page_header_type == 'Vimeo Video') { ?>hasbg <?php if(!empty($tg_page_header_bg_parallax)) { ?>parallax<?php } ?> <?php } ?> <?php if(!empty($coursector_topbar)) { ?>withtopbar<?php } ?> <?php if(!empty($coursector_screen_class)) { echo esc_attr($coursector_screen_class); } ?> <?php if(!empty($coursector_page_content_class)) { echo esc_attr($coursector_page_content_class); } ?>" <?php if(!empty($pp_page_bg)) { ?>style="background-image:url(<?php echo esc_url($pp_page_bg); ?>);"<?php } ?> <?php if($page_header_type == 'Youtube Video' OR $page_header_type == 'Vimeo Video') { ?>data-jarallax-video="<?php echo esc_url($video_url); ?>"<?php } ?>>
<?php
if(empty($page_show_title))
{
?>
<?php
if(!empty($pp_page_bg) OR $page_header_type == 'Youtube Video' OR $page_header_type == 'Vimeo Video')
{
?>
<div id="page_caption_overlay"></div>
<?php
}
?>
<div class="page_title_wrapper">
<div class="standard_wrapper">
<div class="page_title_inner">
<?php
$tg_page_title_font_alignment = get_theme_mod('tg_page_title_font_alignment', 'left');
?>
<div class="page_title_content title_align_<?php echo esc_attr($tg_page_title_font_alignment); ?>">
<h1 <?php if(!empty($pp_page_bg) && !empty($coursector_topbar)) { ?>class ="withtopbar"<?php } ?>><?php echo esc_html($page_title); ?></h1>
<?php
if(!empty($page_tagline))
{
?>
<div class="page_tagline">
<?php echo nl2br($page_tagline); ?>
</div>
<?php
}
?>
</div>
</div>
</div>
</div>
<?php
}
?>
</div>
<?php
}
?>
<!-- Begin content -->
<div data-page="<?php echo $current_page_id;?>" id="page_content_wrapper" class="<?php if(!empty($page_boxed_layout)) { ?>blog_wrapper <?php } ?><?php if(!empty($pp_page_bg)) { ?>hasbg <?php } ?><?php if(!empty($pp_page_bg) && !empty($coursector_topbar)) { ?>withtopbar <?php } ?><?php if(!empty($coursector_page_content_class)) { echo esc_attr($coursector_page_content_class); } ?>">
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists