Commit f545a73e authored by agnez's avatar agnez

add home + single

parent 1e722cb0
......@@ -23,6 +23,9 @@ h1, h2, h3, h4, h5, h6{
h1, h2{
text-align: center;
}
h2.textegauche{
text-align: left;
}
.uk-grid > {
h1, h2, h3, h4, h5, h6{
......
......@@ -4,6 +4,8 @@
//
// General
//
@utility-container-max-width: 1200;
@global-border: #999c9e;
//
......
<?php
//L’actualité des GASAP
// * diaporama
$do_not_duplicate = array();
$args = array(
'post_type' => 'post',
'orderby'=> 'date',
'order' => 'DESC',
'category_name' => 'featured',
'paged' => get_query_var( 'paged' ),
'nopaging' => false,
'posts_per_page' => 5
); ?>
<section id="newsslider" class="uk-slidenav-position uk-margin-large-bottom" data-uk-slideshow="{animation:'scroll',autoplay:'true'}">
<ul class="uk-slideshow uk-overlay-active"> <?php
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
if ( has_post_thumbnail() ) {
$thumb_id = get_post_thumbnail_id();
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'diaporama', true);
$slider_excerpt = get_the_excerpt(); ?>
<li>
<a href="<?php the_permalink();?>" rel="bookmark" title="<?php esc_html( get_the_title() );?>">
<div class="uk-cover-background uk-position-cover" style="background-image: url('<?php echo $thumb_url_array[0]; ?>');"></div>
<canvas width="1200" height="370" style="width: 100%; height: auto; opacity: 0;"></canvas>
</a>
<div class="uk-overlay-panel uk-overlay-background uk-overlay-fade uk-flex uk-flex-center uk-flex-middle uk-text-center">
<div>
<h2 class="uk-article-title" itemprop="headline"><a href="<?php the_permalink();?>" title="<?php esc_html( the_title() );?>"><?php the_title(); ?></a></h2>
<p><?php echo $slider_excerpt ?></p>
</div>
</div>
</li><?php
}
$do_not_duplicate[] = get_the_ID();
endwhile;
wp_reset_postdata();?>
</ul>
<a href="" class="uk-slidenav uk-slidenav-contrast uk-slidenav-previous" data-uk-slideshow-item="previous"></a>
<a href="" class="uk-slidenav uk-slidenav-contrast uk-slidenav-next" data-uk-slideshow-item="next"></a>
<ul class="uk-dotnav uk-dotnav-contrast uk-position-bottom uk-flex-center">
<?php while ( $loop->have_posts() ) : $loop->the_post();
static $count = 0; ?>
<li class="" data-uk-slideshow-item="<?php echo $count; ?>"><a href="#">Item <?php echo $count; ?></a></li>
<?php $count++ ;
endwhile;?>
</ul>
</section>
// * diaporama
$do_not_duplicate = array();
$args = array(
'post_type' => 'post',
'orderby'=> 'date',
'order' => 'DESC',
'category_name' => 'featured',
'paged' => get_query_var( 'paged' ),
'nopaging' => false,
'posts_per_page' => 5
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
$do_not_duplicate[] = get_the_ID();
endwhile;
wp_reset_postdata();?>
<section id="snippet_six_news">
<section id="snippet_six_news">
<?php
// 6 dernier news
$loop2 = new WP_Query( array(
'post_type' => 'post',
'orderby' => 'post_date',
'order' => 'DESC',
'posts_per_page' => 6,
'post__not_in' => $do_not_duplicate
));?>
<div class="uk-grid uk-grid-small largeur2" data-uk-grid-margin><?php
while ( $loop2->have_posts() ) : $loop2->the_post();
$random_number = wp_rand( 1, 3 ); ?>
<div class="uk-width-1 uk-width-small-1-2 uk-width-medium-1-3">
<div>
<figure class="uk-overlay">
<?php
if ( has_post_thumbnail() ) { the_post_thumbnail( 'newsthumb', array( 'alt' => '-' ) ); }
else { echo '<img src="' . get_stylesheet_directory_uri() . '/assets/img/default_news_thumbnail.png" width="230" height="210" alt="-">'; }
echo '<img src="' . get_stylesheet_directory_uri() . '/assets/img/news_overlay'.$random_number.'.svg" width="230" height="210" class="uk-overlay-panel uk-overlay-image uk-overlay-fade" alt="-">';
?>
<div class="uk-overlay-panel uk-overlay-background">
<h3><?php the_title(); ?></h3>
<p><?php echo wp_trim_words( get_the_excerpt(), 10, '...' ); ?></p>
<?php esc_html_e( 'Read', 'beans_gasap' ); ?>
</div>
<a class="uk-position-cover" href="<?php echo get_the_permalink(); ?>"></a>
</figure>
</div>
$loop2 = new WP_Query( array(
'post_type' => 'post',
'orderby' => 'post_date',
'order' => 'DESC',
'posts_per_page' => 6,
'post__not_in' => $do_not_duplicate
));?>
<div class="uk-grid uk-grid-small largeur2" data-uk-grid-margin><?php
while ( $loop2->have_posts() ) : $loop2->the_post();
$random_number = wp_rand( 1, 3 ); ?>
<div class="uk-width-1 uk-width-small-1-2 uk-width-medium-1-3">
<div>
<figure class="uk-overlay">
<?php
if ( has_post_thumbnail() ) { the_post_thumbnail( 'newsthumb', array( 'alt' => '-' ) ); }
else { echo '<img src="' . get_stylesheet_directory_uri() . '/assets/img/default_news_thumbnail.png" width="230" height="210" alt="-">'; }
echo '<img src="' . get_stylesheet_directory_uri() . '/assets/img/news_overlay'.$random_number.'.svg" width="230" height="210" class="uk-overlay-panel uk-overlay-image uk-overlay-fade" alt="-">';
?>
<div class="uk-overlay-panel uk-overlay-background">
<h3><?php the_title(); ?></h3>
<p><?php echo wp_trim_words( get_the_excerpt(), 10, '...' ); ?></p>
<?php esc_html_e( 'Read', 'beans_gasap' ); ?>
</div>
<a class="uk-position-cover" href="<?php echo get_the_permalink(); ?>"></a>
</figure>
</div>
<?php $do_not_duplicate[] = get_the_ID();
endwhile;
wp_reset_postdata(); ?>
</div>
</section>
\ No newline at end of file
</div>
<?php $do_not_duplicate[] = get_the_ID();
endwhile;
wp_reset_postdata(); ?>
</div>
</section>
\ No newline at end of file
<?php
$do_not_duplicate = array();
$args = array(
'post_type' => 'post',
'orderby'=> 'date',
'order' => 'DESC',
'category_name' => 'featured',
'paged' => get_query_var( 'paged' ),
'nopaging' => false,
'posts_per_page' => 5
); ?>
<section id="newsslider" class="uk-slidenav-position" data-uk-slideshow="{animation:'scroll',autoplay:'true'}">
<ul class="uk-slideshow uk-overlay-active"> <?php
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
if ( has_post_thumbnail() ) {
$thumb_id = get_post_thumbnail_id();
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'diaporama', true);
$slider_excerpt = get_the_excerpt(); ?>
<li>
<a href="<?php the_permalink();?>" rel="bookmark" title="<?php esc_html( get_the_title() );?>">
<div class="uk-cover-background uk-position-cover" style="background-image: url('<?php echo $thumb_url_array[0]; ?>');"></div>
<canvas width="1200" height="370" style="width: 100%; height: auto; opacity: 0;"></canvas>
</a>
<div class="uk-overlay-panel uk-overlay-background uk-overlay-fade uk-flex uk-flex-center uk-flex-middle uk-text-center">
<div>
<h2 class="uk-article-title" itemprop="headline"><a href="<?php the_permalink();?>" title="<?php esc_html( the_title() );?>"><?php the_title(); ?></a></h2>
<p><?php echo $slider_excerpt ?></p>
</div>
</div>
</li><?php
}
$do_not_duplicate[] = get_the_ID();
endwhile;
wp_reset_postdata();?>
</ul>
<a href="" class="uk-slidenav uk-slidenav-contrast uk-slidenav-previous" data-uk-slideshow-item="previous"></a>
<a href="" class="uk-slidenav uk-slidenav-contrast uk-slidenav-next" data-uk-slideshow-item="next"></a>
<ul class="uk-dotnav uk-dotnav-contrast uk-position-bottom uk-flex-center">
<?php while ( $loop->have_posts() ) : $loop->the_post();
static $count = 0; ?>
<li class="" data-uk-slideshow-item="<?php echo $count; ?>"><a href="#">Item <?php echo $count; ?></a></li>
<?php $count++ ;
endwhile;?>
</ul>
</section>
\ No newline at end of file
......@@ -27,7 +27,7 @@ function gasap_enqueue_uikit_assets() {
// Enqueue uikit overwrite theme folder
//beans_uikit_enqueue_theme( 'beans_gasap', get_stylesheet_directory_uri() . '/assets/less/uikit' );
// Add the theme style as a uikit fragment to have access to all the variables
beans_uikit_enqueue_components( array( 'switcher', 'modal', 'tab', 'overlay' ) );
beans_uikit_enqueue_components( array( 'switcher', 'modal', 'tab', 'overlay', 'cover' ) );
beans_uikit_enqueue_components( array( 'slider', 'slideshow', 'grid' ), 'add-ons' );
beans_compiler_add_fragment( 'uikit', get_stylesheet_directory_uri() . '/assets/less/style.less', 'less' );
beans_compiler_add_fragment( 'uikit', get_stylesheet_directory_uri() . '/assets/less/gasap.less', 'less' );
......
<?php
add_action( 'beans_content_prepend_markup', 'gasap_newsslider' );
function gasap_newsslider() {
include (get_stylesheet_directory() . '/assets/template_parts/news_slider.php');
}
add_action( 'beans_content_prepend_markup', 'gasap_latest_news' );
function gasap_latest_news() {
$do_not_duplicate = array();?>
<article id="snippet_latest_news" class="uk-article"><?php
$latest_news = new WP_Query( array(
'post_type' => 'post',
'orderby' => 'post_date',
'order' => 'DESC',
'posts_per_page' => 1
));
while ( $latest_news->have_posts() ) : $latest_news->the_post();
$do_not_duplicate[] = get_the_ID();?>
<div>
<figure class="uk-overlay"><?php
if ( has_post_thumbnail() ) { the_post_thumbnail( 'diaporama', array( 'alt' => '-' ) ); }
else { echo '<img src="' . get_stylesheet_directory_uri() . '/assets/img/default_news_thumbnail.png" width="1200" height="370" alt="-">'; }?>
<div class="uk-overlay-panel uk-overlay-background uk-text-center">
<h3 class="uk-article-title"><?php the_title(); ?></h3>
</div>
<a class="uk-position-cover" href="<?php echo get_the_permalink(); ?>"></a>
</figure>
<div><?php the_content(); ?></div>
<?php edit_post_link( esc_html__( 'Edit news', 'beans_gasap' ), '<span class="edit-link">', '</span>' ); ?>
</div><?php
endwhile;
wp_reset_postdata(); ?>
</article>
<section id="snippet_next_three_news">
<?php
$loop2 = new WP_Query( array(
'post_type' => 'post',
'orderby' => 'post_date',
'order' => 'DESC',
'posts_per_page' => 3,
'post__not_in' => $do_not_duplicate
));?>
<div class="uk-grid uk-grid-small largeur2" data-uk-grid-margin><?php
while ( $loop2->have_posts() ) : $loop2->the_post();
$random_number = wp_rand( 1, 3 ); ?>
<div class="uk-width-1 uk-width-small-1-2 uk-width-medium-1-3">
<div>
<figure class="uk-overlay">
<?php
if ( has_post_thumbnail() ) { the_post_thumbnail( 'newsthumb', array( 'alt' => '-' ) ); }
else { echo '<img src="' . get_stylesheet_directory_uri() . '/assets/img/default_news_thumbnail.png" width="230" height="210" alt="-">'; }?>
<a class="uk-position-cover" href="<?php echo get_the_permalink(); ?>"></a>
</figure>
<h2 class="textegauche"><?php the_title(); ?></h2>
<a class="uk-button uk-button-success" href="<?php echo get_the_permalink(); ?>"><?php esc_html_e( 'Discover', 'beans_gasap' ); ?></a>
</div>
</div><?php
endwhile;
wp_reset_postdata(); ?>
</div>
</section><?php
}
beans_remove_action( 'beans_loop_template' );
add_action( 'beans_content_after_markup', 'gasap_bottom' );
function gasap_bottom() {
include (get_stylesheet_directory() . '/assets/template_parts/contact_calendar.php');
include (get_stylesheet_directory() . '/assets/template_parts/footer.php');
}
// Load document which is always needed at the bottom of template files.
beans_load_document();
......@@ -177,6 +177,7 @@ function add_contentpieces_after_les_mangeurs() { ?>
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/news_slider.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');
......
......@@ -69,6 +69,7 @@ function add_page_le_gasap_content_pieces() {
<?php
include (get_stylesheet_directory() . '/assets/template_parts/three_steps.php');// Comment devenir membre en 3 étapes ?
include (get_stylesheet_directory() . '/assets/template_parts/three_producers.php');
include (get_stylesheet_directory() . '/assets/template_parts/news_slider.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');
......
......@@ -197,6 +197,7 @@ function add_contentpieces_after_lereaseau() { ?>
</article>
<?php
include (get_stylesheet_directory() . '/assets/template_parts/three_producers.php');
include (get_stylesheet_directory() . '/assets/template_parts/news_slider.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');
......
......@@ -118,6 +118,7 @@ Comment devenir producteur pour les GASAP ?
<?php
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/news_slider.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');
......
<?php
/**
* This core file should strictly be overwritten via your child theme.
*
* We strongly recommend to read Beans documentation to find out more how to
* customize Beans theme.
*
* @author Beans
* @link http://www.getbeans.io
*/
beans_remove_markup( 'beans_post_image' );
add_action( 'beans_post_after_markup', 'add_single_content_pieces' );
function add_single_content_pieces() {
include (get_stylesheet_directory() . '/assets/template_parts/news_slider.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();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment