fbpx

template member

<?php /* Template Name: Membres accueil*/ 
// check if login eMember
global $is_member_area, $show_custom_slider;
$is_member_area = false;
if(!wp_emember_is_member_logged_in()){
	$login_page_id = ICL_LANGUAGE_CODE=='en' ? 23 : 431 ;
	wp_redirect( get_permalink($login_page_id) ); 
	exit;
}else{
	$is_member_area = true;
}
$show_custom_slider = true;
get_header(); 


$posts = get_posts(array(
			'post_type'	=> 'news',
			'suppress_filters' => false,
			'posts_per_page'   => 12,
			'orderby'	=> 'date',
			'order'		=> 'DESC'
		));
		
$nb= 0;
$img_slider = array();
$titles = array();
$prev = array();
$url = array();
$date_p = array();
 foreach( $posts as $post ):
	if ($nb < 3)
	{
		$img_slider[] = wp_get_attachment_url( get_post_thumbnail_id() );
		$prev[] = wp_trim_words($post->post_content,20);
		$date_p[] = get_field('news_date',$post->ID) ? explode(' ',get_field('news_date',$post->ID)) : array(get_the_time('j',$post->ID), get_the_time('F',$post->ID));
		$pdf[] = get_field('pdf_document',$post->ID);
		
		
	}
	$titles[] = get_the_title($post->ID);
	$url[] = get_permalink($post->ID);
 
	$nb++;
 endforeach;

if ($nb < 3)
	$max = $nb;
else
	$max = 3
?>
<section>
	<div class="slider clearfix">
		<ul class="bxslider">
		<?php
		for($i = 0; $i < $max; $i++){	
			if(!empty($pdf[$i]['filename']))
				echo "<a href=\"" . $pdf[$i]['url'] . "\" target=_blank>";
			else
				echo "<a href=\"" . $url[$i] . "\">";
			
			echo "<li style=\"background-image: url('" . $img_slider[$i]  . "');\">";
				echo '<span class="news_title">' . $titles[$i] . '</span>';
			echo "</li></a>";
		}
		?>
		</ul>	
	</div>
</section>




<div class="membre-id-logout fullpagewidth clearfix tright">
	<?php echo eMember_compact_login_widget(); ?> 

</div>	

<section class="main-content">
    <div class="fullpagewidth clearfix">
			<div class="col2_3_wmargin">
			
				<div class="news title">
					<div class="date_left">
						&nbsp;
					</div>
					<div class="news_right">
						<h1 class="page-title"><?php echo __('HILLSDALE STORYLINES','lithiummarketing');?></h1>
					</div>
				</div>
				
				<?php
				for($i = 0; $i < $max; $i++){
					?>
					<div class="news">
						<div class="date_left">
							<p class="day"><?php echo $date_p[$i][0];?></p>
							<p class="month"><?php echo $date_p[$i][1];?></p>
						</div>
						<div class="news_right">
							<h3 class="page-title"><?php echo $titles[$i];?></h3>
							<p><?php //echo $prev[$i];?>&nbsp;</p>
							<?php 
							if(!empty($pdf[$i]['filename']))
							{	
							?>
								<p class="readmore"><a href="<?php echo $pdf[$i]['url'];?>" target=_blank><?php echo __('Read more','lithiummarketing');?> <i class="fa fa-angle-right" aria-hidden="true"></i></a></p>
							<?php
							}
							else
							{	
							?>
								<p class="readmore"><a href="<?php echo $url[$i];?>"><?php echo __('Read more','lithiummarketing');?> <i class="fa fa-angle-right" aria-hidden="true"></i></a></p>
							<?php
							}
								
							?>
						</div>
					</div>
					<?php
				}	
				?>
               
               
               <div class="link fullpagewidth clearfix" style="text-align:left;">
                    <div class="col_auto">
                        <div class="image">
                            <img src="<?php echo get_template_directory_uri(); ?>/images/ic-teetime.png"/>
                        </div>
                        <div class="texte">
                            <?php 
							$page_id = ICL_LANGUAGE_CODE=='en' ? 890 : 906 ; 
							$regexp = ICL_LANGUAGE_CODE=='en' ? '(\s.+)' : '' ;
							?>
                            <a class="gggolf-member-link" href="https://secure.gggolf.ca/hillsdale/index.php?option=com_ggmember&req=autogrid&lang=en&p0=Transaction&v0=FindMyTeeTimes&p1=Typ&v1=H2113" target="_blank"><?php echo preg_replace('/'.$regexp.'\s/','$1<br>',get_the_title($page_id),1); ?></a>
                        </div>
                    </div>
                    <div class="col_auto">
                        <div class="image">
                            <img src="<?php echo get_template_directory_uri(); ?>/images/ic-tournament.png"/>
                        </div>
                        <div class="texte">
                            <?php 
							$page_id = ICL_LANGUAGE_CODE=='en' ? 893 : 910 ; 
							$regexp = ICL_LANGUAGE_CODE=='en' ? '(\s.+)' : '' ;  
							?>
                            <a class="gggolf-member-link" href="https://secure.gggolf.ca/hillsdale/index.php?option=com_ggmember&req=autogrid&lang=en&p0=Transaction&v0=FindTournaments&p1=Typ&v1=R" target="_blank"><?php echo preg_replace('/'.$regexp.'\s/','$1<br>',get_the_title($page_id),1); ?></a>
                        </div>
                    </div>
                    <div class="col_auto">
                        <div class="image">
                            <img src="<?php echo get_template_directory_uri(); ?>/images/ic-golf.png"/>
                        </div>
                        <div class="texte">
                            <?php $page_id = ICL_LANGUAGE_CODE=='en' ? 897 : 901 ; ?>
                            <a class="gggolf-member-link" href="https://secure.gggolf.ca/hillsdale/index.php?option=com_ggmember&req=autogrid&lang=en&p0=Transaction&v0=FindTeeTimes&p1=Res&v1=D" target="_blank"><?php echo preg_replace('/(\s.+)\s/','$1<br>',get_the_title($page_id),1); ?></a>
                        </div>
                    </div>
                </div>
               
            </div>
            <div class="col1_3r fright">
                <?php dynamic_sidebar( 'custom-menu' ); ?>
                <?php if(count($titles)>3){?>
                <h2 class="news"><?php echo __('MORE NEWS','lithiummarketing'); ?></h2>
				<ul class="morenews">
				<?php
				for($i = 3; $i < count($titles); $i++){
					echo '<li><a href="' . $url[$i] . '">' .  $titles[$i] . '</a></li>';
				}	
				?>
				</ul>
                <?php }?>
            </div>
    </div>
    <?php $acces = _lm_gggolf_set_credential();?>
    <form id="form-gggolf" action="" method="POST" target="_blank">
    	<input type="hidden" name="logged" value="" />
    	<input type="hidden" name="jump" value="1" />
    	<input type="hidden" name="mno" value="<?php echo $acces['mno'];?>" />
    	<input type="hidden" name="pwd" value="<?php echo $acces['pwd'];?>" />
    </form>
</section>
<?php get_footer(); ?>
Questions?
Réinitialiser le mot de passe
Veuillez entrer votre email. Vous allez recevoir votre nouveau mot de passe par email.