page-12.php 5.83 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
 
<?php
/**
 * page Les mangeurs
 *
 */
beans_add_attribute( 'beans_post_content', 'class', 'uk-column-medium-1-2' );


add_action( 'beans_post_before_markup', 'page_les_mangeurs_before' );
function page_les_mangeurs_before() { ?>
	<div id="snippet_p12">
	<?php 
}
add_action( 'beans_post_prepend_markup', 'page_les_mangeurs_in_start' );
function page_les_mangeurs_in_start() { ?>
	<div class="largeur2"> <?php 
}
add_action( 'beans_post_body_append_markup', 'page_les_mangeurs_in_after_body' );
function page_les_mangeurs_in_after_body() {
		$argspourquoi = array(
			'post_type' => 'contentpiece', 
			'orderby'=> 'title', 
			'order' => 'DESC',
			'tax_query' => array(
				array(
					'taxonomy' => 'contentpiecetype',
					'field'    => 'term_id',
					'terms'    => 20 //FIX db entry
				)
			)
		); 
		$pourquoi = new WP_Query( $argspourquoi );
		 ?><div class="uk-grid"> <?php
			while ( $pourquoi->have_posts() ) : $pourquoi->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><?php
}
add_action( 'beans_post_append_markup', 'page_les_mangeurs_in_end' );
function page_les_mangeurs_in_end() { ?>
	</div> <?php 
}


add_action( 'beans_post_after_markup', 'add_contentpieces_after_les_mangeurs' );
function add_contentpieces_after_les_mangeurs() { ?>
	</div>
	<article id="snippet_mangeurs_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'    => 13 //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
72
			<div class="uk-panel uk-panel-box uk-panel-box-secondary gasap-panel-box uk-panel-header">
agnez's avatar
agnez committed
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 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 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 175 176 177 178 179 180
				<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() );?>
						<div class="uk-width-1 uk-width-medium-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_mange_chouette"><div class="largeur2">
	<?php
		$argsmangechouette = array(
			'post_type' => 'contentpiece', 
			'orderby'=> 'date', 
			'order' => 'ASC',
			'tax_query' => array(
				array(
					'taxonomy' => 'contentpiecetype',
					'field'    => 'term_id',
					'terms'    => 14 //FIX db entry
				)
			)
		); 
		$mangechouette = new WP_Query( $argsmangechouette );
		 ?><div class="uk-grid"> <?php
			while ( $mangechouette->have_posts() ) : $mangechouette->the_post();
				?><div class="uk-width-1 uk-width-medium-1-2">
					<?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>

	<article id="snippet_avantages"><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'    => 11 //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-medium-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_les_engagements">
		<h2><?php esc_html_e( 'Les engagements', 'beans_gasap' ); // Les engagements ?></h2>
		<div class="uk-grid">	
		<?php 
		$argsengagements = array(
			'post_type' => 'contentpiece', 
			'orderby'=> 'date', 
			'order' => 'ASC',
			'tax_query' => array(
				array(
					'taxonomy' => 'contentpiecetype',
					'field'    => 'term_id',
					'terms'    => 15 //FIX db entry
				)
			)
		); 
		$engagements = new WP_Query( $argsengagements );
		while($engagements->have_posts()) : $engagements->the_post(); ?>
			<div class="uk-width-1 uk-width-medium-1-2 uk-width-large-1-4">
				<?php the_post_thumbnail('thumbnail'); ?>
				<?php the_content(); ?>
				<?php edit_post_link( esc_html__( 'Edit snippet', 'beans_gasap' ), '<span class="edit-link">', '</span>' ); ?>
			</div>
		<?php endwhile; ?>
		</div>		
	</article>

	<?php
	include (get_stylesheet_directory() . '/assets/template_parts/three_steps.php');// Comment devenir membre en 3 étapes ?
	include (get_stylesheet_directory() . '/assets/template_parts/gasap_map.php');
	include (get_stylesheet_directory() . '/assets/template_parts/three_producers.php');
	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();