page-8.php 6.3 KB
Newer Older
agnez's avatar
agnez committed
1 2 3 4
<?php
/**
 * page Les producteurs
 */
agnez's avatar
agnez committed
5 6
beans_add_attribute( 'beans_post_content', 'class', 'uk-column-medium-1-2' );

agnez's avatar
agnez committed
7
add_action( 'beans_post_before_markup', 'page_les_producteurs_before' );
agnez's avatar
agnez committed
8
function page_les_producteurs_before() {?>
9
	<div id="snippet_p8"><?php 	
agnez's avatar
agnez committed
10 11 12
}

add_action( 'beans_post_after_markup', 'add_contentpieces_after_les_producteurs' );
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
function add_contentpieces_after_les_producteurs() { 
	?>
<article id="snippet_les_producteurs">	
<div class="largeur2"><?php
		$args_les_producteurs = array(
			'post_type' => 'contentpiece', 
			'orderby'=> 'title', 
			'order' => 'DESC',
			'tax_query' => array(
				array(
					'taxonomy' => 'contentpiecetype',
					'field'    => 'term_id',
					'terms'    => 85 //FIX db entry
				)
			)
		);
		$les_producteurs = new WP_Query( $args_les_producteurs );
		 ?><div class="uk-grid"> <?php
			while ( $les_producteurs->have_posts() ) : $les_producteurs->the_post();
				?><div class="uk-width-1 uk-width-small-1-2">
					<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();?>
		</div>
</div>
</article>
agnez's avatar
agnez committed
41
	</div>
agnez's avatar
agnez committed
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
	<article id="snippet_prod_comment">
		<div class="largeur3"><?php
		$args_comment_images = array(
			'post_type' => 'attachment',
			'post_mime_type' => 'image',
			'orderby'=> 'date',
			'order' => 'ASC',
			'post_status'    => 'inherit',
			'tax_query' => array(
				array(
					'taxonomy' => 'media_usage',
					'field'    => 'term_id',
					'terms'    => 17 //FIX db entry
				)
			)
		);
		$comment = new WP_Query( array( 'post_type' => 'contentpiece','p' => 65) ); //FIX db entry
		$comment_images = new WP_Query( $args_comment_images ); 
		while($comment->have_posts()) : $comment->the_post(); ?>
agnez's avatar
agnez committed
61
			<div class="uk-panel uk-panel-box gasap-panel-box uk-panel-header">
agnez's avatar
agnez committed
62 63 64 65 66 67 68 69 70 71
				<h2 class="uk-panel-title"><?php the_title(); ?></h2>
				<div class="textegauche"><?php the_content(); ?></div>
				<?php edit_post_link( esc_html__( 'Edit snippet', 'beans_gasap' ), '<p class="edit-link">', '</p>' ); ?>				
				<div class="uk-grid"><?php
					while ( $comment_images->have_posts() ) : $comment_images->the_post();
						$image = wp_get_attachment_image_src( get_the_ID(),'thumbnail' );?>
						<div class="uk-width-1 uk-width-small-1-3">
							<img src="<?php echo $image[0];?>" />
							<div><?php the_title(); ?></div>
						</div>
agnez's avatar
agnez committed
72 73
					<?php endwhile;
					wp_reset_postdata();?>
agnez's avatar
agnez committed
74 75
				</div>				
			</div>
agnez's avatar
agnez committed
76 77
		<?php endwhile; 
		wp_reset_postdata();?>
agnez's avatar
agnez committed
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
		</div>
	</article> 

	<article id="snippet_avantages_prod"><div class="largeur2">
		<h2><?php esc_html_e( 'Les avantages', 'beans_gasap' ); ?></h2>
	<?php
		$argsavantages = array(
			'post_type' => 'contentpiece', 
			'orderby'=> 'date', 
			'order' => 'ASC',
			'tax_query' => array(
				array(
					'taxonomy' => 'contentpiecetype',
					'field'    => 'term_id',
					'terms'    => 18 //FIX db entry
				)
			)
		); 
		$avantages = new WP_Query( $argsavantages ); 
			?> <div class="uk-grid"> <?php
			while ( $avantages->have_posts() ) : $avantages->the_post();?>
				<div class="uk-width-1 uk-width-small-1-2">
						<h3><?php the_title(); ?></h3><?php
						the_content();
						edit_post_link( esc_html__( 'Edit snippet', 'beans_gasap' ), '<span class="edit-link">', '</span>' );?>
				</div><?php
agnez's avatar
agnez committed
104 105
			endwhile;
			wp_reset_postdata();?>
agnez's avatar
agnez committed
106 107 108 109 110 111 112 113
		</div>			
	</div></article>

	<article id="snippet_prod_engagements"><div class="largeur2 uk-text-center">
		<h2><?php esc_html_e( 'Les engagements', 'beans_gasap' ); ?></h2><?php
		$engagement = new WP_Query( array( 'post_type' => 'contentpiece','p' => 108) ); //FIX db entry 
		while($engagement->have_posts()) : $engagement->the_post(); ?>
			<h3><?php the_title(); ?></h3>
114
			<div><?php the_content(); ?></div><?php 
agnez's avatar
agnez committed
115
		endwhile;
agnez's avatar
agnez committed
116
		wp_reset_postdata();
agnez's avatar
agnez committed
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
		$argslesengagements = array(
			'post_type' => 'contentpiece', 
			'orderby'=> 'date', 
			'order' => 'ASC',
			'tax_query' => array(
				array(
					'taxonomy' => 'contentpiecetype',
					'field'    => 'term_id',
					'terms'    => 19 //FIX db entry
				)
			)
		); 
		$lesengagements = new WP_Query( $argslesengagements );
		 ?><div class="uk-grid"> <?php
			while ( $lesengagements->have_posts() ) : $lesengagements->the_post();
				?><div class="uk-width-1 uk-width-small-1-2 uk-width-medium-1-4">
					<?php if ( has_post_thumbnail() ) { the_post_thumbnail('thumbnail'); } ?>
					<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
agnez's avatar
agnez committed
138 139
			 endwhile;
			 wp_reset_postdata();?>
agnez's avatar
agnez committed
140 141
		</div>
	</div></article>
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174

	<article id="snippet_comment_devenir_prod"><div class="largeur1 uk-text-center"><?php
		$engagement = new WP_Query( array( 'post_type' => 'contentpiece','p' => 1022) ); //FIX db entry 
		while($engagement->have_posts()) : $engagement->the_post(); ?>
			<h2><?php the_title(); ?></h2>
			<div><?php the_content(); ?></div><?php 
		endwhile;
		wp_reset_postdata();
		$argscommentdevenirprod = array(
			'post_type' => 'contentpiece', 
			'orderby'=> 'date', 
			'order' => 'ASC',
			'tax_query' => array(
				array(
					'taxonomy' => 'contentpiecetype',
					'field'    => 'term_id',
					'terms'    => 96 //FIX db entry
				)
			)
		); 
		$commentdevenirprod = new WP_Query( $argscommentdevenirprod );
		 ?><div class="uk-grid"> <?php
			while ( $commentdevenirprod->have_posts() ) : $commentdevenirprod->the_post();
				?><div class="uk-width-medium-1-3">
					<?php if ( has_post_thumbnail() ) { the_post_thumbnail('thumbnail'); } ?>
					<div class="content"><?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();?>
		</div>
	</div></article>

agnez's avatar
agnez committed
175
	<?php
agnez's avatar
agnez committed
176
	include (get_stylesheet_directory() . '/assets/template_parts/map_prod.php');
agnez's avatar
agnez committed
177
	//include (get_stylesheet_directory() . '/assets/template_parts/three_producers.php');
agnez's avatar
agnez committed
178
	include (get_stylesheet_directory() . '/assets/template_parts/news_slider.php');	
agnez's avatar
agnez committed
179
	include (get_stylesheet_directory() . '/assets/template_parts/latest_news.php');
agnez's avatar
agnez committed
180 181 182 183 184
	include (get_stylesheet_directory() . '/assets/template_parts/contact_calendar.php');
	include (get_stylesheet_directory() . '/assets/template_parts/footer.php');
}

beans_load_document();