page-8.php 3.85 KB
Newer Older
agnez's avatar
agnez committed
1 2 3 4 5 6 7 8 9 10 11 12 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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 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 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
 
<?php
/**
 * page Les producteurs
 *
 */
add_action( 'beans_post_before_markup', 'page_les_producteurs_before' );
function page_les_producteurs_before() {
		?>
	<article id="snippet_p8">
	<?php 
}

add_action( 'beans_post_after_markup', 'add_contentpieces_after_les_producteurs' );
function add_contentpieces_after_les_producteurs() { ?>
	</article>
	<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(); ?>
			<div class="uk-panel uk-panel-box uk-panel-header">
				<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>
					<?php endwhile;?>
				</div>				
			</div>
		<?php endwhile; ?>
		</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
			endwhile;?>
		</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>
			<div class="largeur2"><?php the_content(); ?></div><?php 
		endwhile;
		$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
			 endwhile;?>
		</div>
	</div></article>
	<?php
	include (get_stylesheet_directory() . '/assets/template_parts/contact_calendar.php');
	include (get_stylesheet_directory() . '/assets/template_parts/footer.php');
}

beans_load_document();