<?php
/**
 * Template Name: User Login Page
 *
 * @package WordPress
 * @subpackage Charity
 * @since Charity 1.0
 */
?>
<?php
	if ( is_user_logged_in() ) {
		$wplook_login_url = ot_get_option('wpl_donations_link' ) ? get_permalink( ot_get_option('wpl_donations_link' ) ) : home_url();
		return wp_redirect( $wplook_login_url  ); exit;
	}
	$wplook_page_header = (isset($wplook_page_meta['wpl_page_header'][0]) && $wplook_page_meta['wpl_page_header'][0] != '') ? $wplook_page_meta['wpl_page_header'][0] : false;
 ?>
<?php get_header(); ?>

	<div class="main">
		<div class="main-head">
			<div class="main-head-image fullscreener">
				<?php
					if ( $wplook_page_header ) {
						echo '<img class="hide" src="'.esc_url( $wplook_page_header ).'">';
					}?>
			</div><!-- /.main-head-image fullscreener -->
			<div class="main-head-content">
				<div class="grid-container">
					<div class="grid-x grid-margin-x">
						<div class="cell small-12">
							<h1 class="main-title main-title-alt"><?php the_title(); ?></h1><!-- /.main-title main-title-alt -->
							<?php if (ot_get_option('wpl_breadcrumbs_status') == 'on') : ?>
								<ul class="breadcrumbs">
									<?php wplook_breadcrumbs(); ?>
								</ul><!-- /.breadcrumbs -->
							<?php endif; ?>
						</div><!-- /.cell small-12 -->
					</div><!-- /.grid-x grid-margin-x -->
				</div><!-- /.grid-container -->
			</div><!-- /.main-head-content -->
		</div><!-- /.main-head -->
		<div class="main-body">
			<div class="grid-container">
				<div class="grid-x grid-margin-x">
					<div class="cell small-12">
						<div class="content">
							<article id="post-<?php the_ID(); ?>" <?php post_class('post post-single post-event'); ?>>
								<div class="grid-container">
									<div class="grid-x grid-margin-x align-center">
										<div class="cell small-4 large-centered">
											<?php wp_login_form(); ?>
										</div>
									</div><!-- /.grid-x grid-margin-x -->
								</div><!-- /.grid-container -->
							</article>
						</div><!-- /.content -->
					</div><!-- /.cell large-12 -->
				</div><!-- /.grid-x grid-margin-x -->
			</div><!-- /.grid-container -->
		</div><!-- /.main-body -->
	</div><!-- /.main -->
<?php get_footer(); ?>
