page-6.php 7.16 KB
Newer Older
agnez's avatar
agnez committed
1 2 3 4 5 6 7 8
<?php
/**
 * page Le réseau des GASAP
 *
 */


beans_add_attribute( 'beans_post_body', 'class', 'uk-grid' );
agnez's avatar
agnez committed
9
beans_add_attribute( 'beans_post_title', 'class', 'textegauche' );
agnez's avatar
agnez committed
10 11 12 13 14 15 16 17 18 19 20 21
beans_add_attribute( 'beans_post_image', 'class', 'uk-width-1-1 uk-width-small-1-2' );
beans_add_attribute( 'beans_post_content', 'class', 'uk-width-1-1 uk-width-small-1-2' );

add_action( 'beans_post_before_markup', 'page_le_reseau_before' );
function page_le_reseau_before() { ?>
	<div id="snippet_p6">
	<?php 
}

add_action( 'beans_post_content_append_markup', 'add_tree_snippets' );
function add_tree_snippets() {?>
		<div class="uk-grid">
agnez's avatar
agnez committed
22
			<h2 class="uk-width-1-1 textegauche h1"><?php esc_html_e( 'Les objectifs', 'beans_gasap' ); ?></h2>
agnez's avatar
agnez committed
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
			<?php 
			$args_objectifs = array(
				'post_type' => 'contentpiece', 
				'orderby'=> 'title', 
				'order' => 'DESC',
				'tax_query' => array(
					array(
						'taxonomy' => 'contentpiecetype',
						'field'    => 'term_id',
						'terms'    => 9 //FIX term "page le réseau - objectifs"
					)
				)
			); //only taxonomy bouton 
			$loop_objectifs = new WP_Query( $args_objectifs );
			while ( $loop_objectifs->have_posts() ) : $loop_objectifs->the_post(); ?>
				<div class="uk-width-1-1 uk-width-small-1-2"><?php
						the_content();
						edit_post_link( esc_html__( 'Edit snippet', 'beans_gasap' ), '<p class="edit-link">', '</p>' ); 
					?>
				</div>
			<?php endwhile;
			wp_reset_postdata();?>
		</div>
	<?php
}

add_action( 'beans_post_after_markup', 'add_contentpieces_after_lereaseau' );
function add_contentpieces_after_lereaseau() { ?>
	</div>
	<article id="snippet_reseau_pourquoi">
		<div class="largeur1">
agnez's avatar
agnez committed
54
	 		<h2 class="espacer h1 serrer"><?php esc_html_e( 'Pourquoi faire partie du Réseau des GASAP ?', 'beans_gasap' ) ?></h2><?php // Titre FIX
agnez's avatar
agnez committed
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
			$args_pourquoi = array(
				'post_type' => 'contentpiece', 
				'orderby'=> 'title', 
				'order' => 'ASC',
				'tax_query' => array(
					array(
						'taxonomy' => 'contentpiecetype',
						'field'    => 'term_id',
						'terms'    => 10 //FIX  term "page le réseau - pourquoi"
					)
				)
			);
			$loop_pourquoi = new WP_Query( $args_pourquoi );
			$rowCount = 0;			
			while ( $loop_pourquoi->have_posts() ) : $loop_pourquoi->the_post(); ?>
				<div class="uk-grid">
					<div class="uk-width-1-1 uk-width-small-1-2 <?php if ($rowCount % 2 == 1 ) echo 'uk-push-1-2';?>">
						<h3 class="uk-visible-small"><?php the_title(); ?></h3><?php
						the_post_thumbnail('medium'); ?>
					</div>
					<div class="uk-width-1-1 uk-width-small-1-2 <?php if ($rowCount++ % 2 == 1 ) echo 'uk-pull-1-2';?>">
						<h3 class="uk-hidden-small"><?php the_title(); ?></h3><?php
						the_content();
						edit_post_link( esc_html__( 'Edit snippet', 'beans_gasap' ), '<span class="edit-link">', '</span>' ); 
						?>
					</div>
				</div>
			<?php endwhile;?>
		</div>
	</article>

agnez's avatar
agnez committed
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
	<article id="snippet_qui_est_le_reseau"><div class="largeur2 uk-text-center"><?php
		$quiestlereseau = new WP_Query( array( 'post_type' => 'contentpiece','p' => 910) ); //FIX db entry 
		while($quiestlereseau->have_posts()) : $quiestlereseau->the_post(); ?>
			<h2 class="h1"><?php the_title(); ?></h2>
			<div class="largeur2"><?php the_content(); ?></div><?php 
		endwhile;
		wp_reset_postdata();?>
		</div>
	</div></article>

	<?php 
	$workertype = 91;
	include( locate_template( '/assets/template_parts/the_workers.php', false, false ) );
	$workertype = '';
	?>

	<article id="snippet_benevoles"><div class="uk-text-center"><?php
		$benevoles = new WP_Query( array( 'post_type' => 'contentpiece','p' => 909) ); //FIX db entry 
		while($benevoles->have_posts()) : $benevoles->the_post(); ?>
			<h2><?php the_title(); ?></h2>
			<div class="largeur2"><?php the_content(); ?></div><?php 
		endwhile;
		wp_reset_postdata();
		$argslesbenevoles = array(
			'post_type' => 'contentpiece', 
			'orderby'=> 'date', 
			'order' => 'ASC',
			'tax_query' => array(
				array(
					'taxonomy' => 'contentpiecetype',
					'field'    => 'term_id',
					'terms'    => 92 //FIX db entry
				)
			)
		); 
		$lesbenevoles = new WP_Query( $argslesbenevoles );
		 ?><div class="uk-grid"> <?php
			while ( $lesbenevoles->have_posts() ) : $lesbenevoles->the_post();
				?><div class="uk-width-1 uk-width-small-1-2 uk-width-medium-1-4">
					<h3><?php the_title(); ?></h3>
					<div><?php the_content(); ?></div>
					<?php edit_post_link( esc_html__( 'Edit snippet', 'beans_gasap' ), '<span class="edit-link">', '</span>' );?>
				</div><?php
			 endwhile;
			 wp_reset_postdata();?>
agnez's avatar
agnez committed
131
		</div>
agnez's avatar
agnez committed
132 133
	</div></article>

agnez's avatar
agnez committed
134 135 136 137 138 139 140 141 142
	<article id="snippet_devenir_benevole"><div>
		<div class="largeur3 uk-text-center"><?php
			$devenir_benevole = new WP_Query( array( 'post_type' => 'contentpiece','p' => 203) ); //FIX db entry
			while($devenir_benevole->have_posts()) : $devenir_benevole->the_post(); ?>
				<h2><?php the_title(); ?></h2>
				<div><?php the_content(); ?></div>
				<?php edit_post_link( esc_html__( 'Edit snippet', 'beans_gasap' ), '<p class="edit-link">', '</p>' ); ?>
			<?php endwhile; 
			wp_reset_postdata();?>		
143
			<a class="uk-button uk-button-success" href="mailto:benevoles@gasap.be"><?php esc_html_e( 'Dévenir bénévole', 'beans_gasap' ); ?></a>
agnez's avatar
agnez committed
144
		</div></div>
agnez's avatar
agnez committed
145 146
	</article>		

agnez's avatar
agnez committed
147 148
	<?php include (get_stylesheet_directory() . '/assets/template_parts/the_workers.php'); ?>	

agnez's avatar
agnez committed
149
	<article  id="snippet_partenaires" class="uk-slidenav-position" data-uk-slider="{center:true}">
agnez's avatar
agnez committed
150
		<div>
agnez's avatar
agnez committed
151
			<h2><?php esc_html_e( 'Nos partenaires', 'beans_gasap' ) ?></h2>
agnez's avatar
agnez committed
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
			<div class="uk-slider-container">
				
				<ul class="uk-slider uk-grid-width-medium-1-3 uk-grid-width-large-1-5"> <?php
					$argspartner = array(
						'post_type' => 'partner', 
						'order_by' => 'rand'
					);
					$looppartner = new WP_Query( $argspartner );
					while ( $looppartner->have_posts() ) : $looppartner->the_post();
						if ( has_post_thumbnail() ) { ?>
							<li><a href="<?php echo get_post_meta( get_the_ID(), '_partenaire_url', true ) ?>" title="<?php the_title(); ?>" target="_blank"><?php the_post_thumbnail('thumbnail'); ?></a></li><?php
						}
					endwhile;
					wp_reset_postdata();?>
				</ul>
			</div>
		</div>
agnez's avatar
agnez committed
169 170 171 172
		<a href="" class="uk-slidenav uk-slidenav-contrast uk-slidenav-previous" data-uk-slider-item="previous"></a>
		<a href="" class="uk-slidenav uk-slidenav-contrast uk-slidenav-next" data-uk-slider-item="next"></a>      
	</article>

agnez's avatar
agnez committed
173
	<article id="snippet_documents">
agnez's avatar
agnez committed
174 175 176 177 178 179 180
		<div class="largeur3"><?php
			$nos_documents = new WP_Query( array( 'post_type' => 'contentpiece','p' => 132) ); //FIX db entry
			while($nos_documents->have_posts()) : $nos_documents->the_post(); ?>
				<h2><?php the_title(); ?></h2>
				<div><?php the_content(); ?></div>
				<?php edit_post_link( esc_html__( 'Edit snippet', 'beans_gasap' ), '<p class="edit-link">', '</p>' ); ?>
			<?php endwhile; 
agnez's avatar
agnez committed
181 182
			wp_reset_postdata();?>
		</div>	
agnez's avatar
agnez committed
183 184 185
	</article>


agnez's avatar
agnez committed
186 187
	<?php	
	include (get_stylesheet_directory() . '/assets/template_parts/three_producers.php');
agnez's avatar
agnez committed
188
	include (get_stylesheet_directory() . '/assets/template_parts/news_slider.php');	
agnez's avatar
agnez committed
189 190 191 192 193
	include (get_stylesheet_directory() . '/assets/template_parts/latest_news.php');
	include (get_stylesheet_directory() . '/assets/template_parts/contact_calendar.php');	
	include (get_stylesheet_directory() . '/assets/template_parts/footer.php');
}
beans_load_document();