Commit 1e722cb0 authored by agnez's avatar agnez

slider and news

parent b34782dd
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="news_overlay1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="230px" height="210px" viewBox="0 0 230 210" enable-background="new 0 0 230 210" xml:space="preserve">
<radialGradient id="rose">
<stop offset="0" style="stop-color:#DB314B"/>
</radialGradient>
<rect fill="url(#rose)" width="230" height="400"/>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="news_overlay1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="230px" height="210px" viewBox="0 0 230 210" enable-background="new 0 0 230 210" xml:space="preserve">
<radialGradient id="vert">
<stop offset="0" style="stop-color:#afe2d2"/>
</radialGradient>
<rect fill="url(#vert)" width="230" height="400"/>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="news_overlay1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="230px" height="210px" viewBox="0 0 230 210" enable-background="new 0 0 230 210" xml:space="preserve">
<radialGradient id="bleu">
<stop offset="0" style="stop-color:#12a1a5"/>
</radialGradient>
<rect fill="url(#bleu)" width="230" height="400"/>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="placeholder" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="600px" height="400px" viewBox="0 0 600 400" enable-background="new 0 0 600 400" xml:space="preserve">
<radialGradient id="SVGID_1_" cx="615.8203" cy="-47.6318" r="447.8687" gradientTransform="matrix(1 0 0 -1 -321 163.5)" gradientUnits="userSpaceOnUse">
<stop offset="0" style="stop-color:#DB314B"/>
<stop offset="1" style="stop-color:#DB314B"/>
</radialGradient>
<rect fill="url(#SVGID_1_)" width="600" height="400"/>
<path fill="#FFFFFF" d="M234.539,148.5v103h130.922v-103H234.539z M354.909,240.33H245.707v-80.661h109.202V240.33L354.909,240.33z"
/>
<polygon fill="#FFFFFF" points="251.58,231.643 274.088,207.984 282.521,211.633 309.13,183.308 319.604,195.836 324.33,192.982
349.898,231.643 "/>
<circle fill="#FFFFFF" cx="277.582" cy="180.18" r="9.83"/>
</svg>
......@@ -211,6 +211,14 @@ main .uk-container{
padding:3em 0 2em;
}
}
#newsslider{
.uk-overlay-panel > div{
max-width: 60%;
}
}
#snippet_six_news{
padding: 3em 0;
}
#snippet_la_carte{
.uk-panel-box {
background: #fafafa none repeat scroll 0 0;
......@@ -220,7 +228,10 @@ main .uk-container{
padding: 15px;
}
}
#snippet_contact_calendrier{
background-color: @bleu-ciel;
padding: 3em 0;
}
#gasap-footer{
background-color: @global-muted-color;
color: white;
......
......@@ -11,23 +11,20 @@
'nopaging' => false,
'posts_per_page' => 5
); ?>
<section class="uk-slidenav-position uk-margin-large-bottom" data-uk-slideshow="{animation:'scroll',autoplay:'true'}">
<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, 'full', true);
$resized_src = beans_edit_image( $thumb_url_array[0], array(
'resize' => array( 1200, 370, true )
) );
$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 $resized_src; ?>');"></div>
<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-top uk-overlay-slide-top">
<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>
......@@ -36,7 +33,8 @@
</li><?php
}
$do_not_duplicate[] = get_the_ID();
endwhile;?>
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>
......@@ -48,10 +46,9 @@
endwhile;?>
</ul>
</section>
<?php
<section id="snippet_six_news">
<?php
// 6 dernier news
$loop2 = new WP_Query( array(
'post_type' => 'post',
......@@ -59,24 +56,29 @@
'order' => 'DESC',
'posts_per_page' => 6,
'post__not_in' => $do_not_duplicate
));
?><div class="uk-grid"><?php
while ( $loop2->have_posts() ) : $loop2->the_post();
?><div class="uk-width-1 uk-width-medium-1-3">
<div class="uk-overlay">
<?php
if ( has_post_thumbnail() ) { the_post_thumbnail( array(230,210) ); }
else { echo '<img src="' . get_stylesheet_directory_uri() . '/assets/img/default_news_thumbnail.png" width="230" height="210" alt="-">'; }
?>
<div class="uk-overlay-panel uk-overlay-background">
<h4><?php the_title(); ?></h4>
<p><?php the_excerpt(); ?></p>
<a href="<?php get_permalink(); ?>"><?php esc_html_e( 'Read', 'beans_gasap' ); ?></a>
));?>
<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>
</div>
</div>
<?php $do_not_duplicate[] = get_the_ID();
endwhile;
?></div>
<?php $do_not_duplicate[] = get_the_ID();
endwhile;
wp_reset_postdata(); ?>
</div>
</section>
\ No newline at end of file
......@@ -8,6 +8,16 @@ require_once( get_template_directory() . '/lib/init.php' );
load_child_theme_textdomain( 'beans_gasap', get_stylesheet_directory() . '/languages' );//Loads the child theme textdomain.
}
/* Image formats */
add_action( 'after_setup_theme', 'gasap_formats', 20 );
function gasap_formats(){
add_theme_support( 'post-thumbnails' );
add_image_size( 'diaporama', 1200, 370, true );
add_image_size( 'newsthumb', 230, 210, true );
}
/*
* Remove this action and callback function if you do not whish to use LESS to style your site or overwrite UIkit variables.
* If you are using LESS, make sure to enable development mode via the Admin->Appearance->Settings option. LESS will then be processed on the fly.
......@@ -17,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' ) );
beans_uikit_enqueue_components( array( 'switcher', 'modal', 'tab', 'overlay' ) );
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' );
......
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