Viewing File: /home/maglabs/lacentraleit/wp-content/themes/mlab/tmpl/header-title.php

<?php
defined( 'ABSPATH' ) or die();


$layout    = mlab_option( 'header__titlebar' );
$alignment = mlab_option( 'header__titlebar__align' );

$current_post = get_queried_object();

if ($current_post instanceof WP_Post) {
	/**
	 * Override layout and alignment settings for the specific entry
	 */
	$_layout = get_field( 'titlebarLayout', $current_post->ID );
	$_alignment = get_field( 'titlebarAlign', $current_post->ID );
}

if ( isset( $_layout ) && $_layout != 'default' ) {
	$layout = $_layout;
}

if ( isset( $_alignment ) && $_alignment != 'default' ) {
	$alignment = $_alignment;
}

if ( ( is_front_page() && mlab_option( 'header__titlebar__home' ) == 'off' ) || $layout == 'none' ) {
	return;
}

$classes = array(
	"content-header",
	"content-header-{$alignment}"
);

if ( is_singular() ) {
	$featured_background_types = (array) mlab_option( 'header__titlebar__backgroundFeatured' );
	$current_post_type         = mlab_current_post_type();


	if ( in_array( $current_post_type, $featured_background_types ) && has_post_thumbnail( $current_post->ID ) ) {
		$classes[] = 'content-header-featured';
	}
}

$featured_background_types = (array) mlab_option( 'header__titlebar__backgroundFeatured' );
$current_post_type         = mlab_current_post_type();
$show_featured_image       = ! in_array( $current_post_type, $featured_background_types ) && has_post_thumbnail();

?>

<div class="<?php echo esc_attr( join( ' ', $classes ) ) ?>">
	<div class="content-header-inner wrap">
		<div class="page-title-wrap">
			<?php if ( is_single( $post ) && $post->post_type == 'nproject' ): ?>
				<?php if ( $client_image_id = get_field( 'projectClientLogo', get_post() ) ): ?>
					<div class="project-client-info">
						<?php
							$image = mlab_get_image_resized( array(
								'image_id' => $client_image_id,
								'size'     => 'full'
							) );

							echo wp_kses_post( $image['thumbnail'] );
						?>
					</div>
				<?php endif ?>
			<?php endif ?>

			<?php if ( in_array( $layout, array( 'both', 'title' ) ) ): ?>
				<?php if ( is_single( $post ) && $post->post_type == 'nproject' ): ?>
					<div class="post-categories">
						<?php echo get_the_term_list( get_the_ID(), 'nproject-category' ) ?>
					</div>
				<?php endif; ?>

				<div class="page-title">
					<?php mlab_header_page_title() ?>
				</div>

				<?php if ( is_single( $post ) && $post->post_type == 'post' ): ?>
					<div class="meta-data">
					<?php if ( mlab_option( 'blog__single__postMeta' ) == 'on' ): ?>
						<ul class="post-meta-single">
							<li>
								<?php echo get_avatar( get_the_author_meta( 'ID' ), 50 ); ?>
							</li>
							<li>
								<span class="prefix"><?php esc_html_e( 'Author', 'mlab' ) ?></span>
								<?php the_author_posts_link() ?>
							</li>
							<li>
								<span class="prefix"><?php esc_html_e( 'Published', 'mlab' ) ?></span>
								<strong><?php echo esc_html( get_the_date( get_option( 'date_format' ) ) ) ?></strong>
							</li>
							<?php if ('open' == $post->comment_status) : ?>
								<li>
									<span class="prefix"><?php comments_popup_link( __( '0 Comment', 'mlab' ), __( '1 Comment', 'mlab' ), __( '% Comments', 'mlab' ) ); ?></span>
									<a href="<?php comments_link(); ?>"><?php esc_html_e( 'Join the Conversation', 'mlab' ) ?></a>
								</li>
							<?php endif; ?>
						</ul>
					</div>
				<?php endif ?>

				<?php wp_reset_postdata() ?>
			<?php endif ?>

		<?php endif ?>
		</div>

		<?php if ( function_exists( 'bcn_display' ) && in_array( $layout, array( 'both', 'breadcrumbs' ) ) ): ?>
			<div class="breadcrumbs">
				<div class="breadcrumbs-inner">
					<?php bcn_display() ?>
				</div>
			</div>
		<?php endif ?>

		<?php if ( mlab_option( 'header__titlebar__scrolldown' ) == 'on' ): ?>
		<div  class="down-arrow">
			<a href="javascript:;">
				<span><?php esc_html_e( 'Scroll Down', 'mlab' ) ?></span>
			</a>
		</div>
	<?php endif ?>

	<?php if ( is_single( $post ) && $post->post_type == 'post' ): ?>
		<?php if ( mlab_option( 'blog__single__postNav' ) == 'on' ): ?>
			<?php get_template_part( 'tmpl/post/content-navigator' ) ?>
		<?php endif ?>
	<?php endif ?>

	<?php if ( is_single( $post ) && $post->post_type == 'nproject' ): ?>
		<?php if ( mlab_option( 'project__pagination' ) == 'on' ): ?>
			<?php get_template_part( 'tmpl/post/content-navigator' ) ?>
		<?php endif ?>
	<?php endif ?>
	</div>
</div>
Back to Directory File Manager