ldc-groupe/content/themes/ldc/page-press.php
Vincent BRIDIER 067c15466a - Retours 2
2020-06-25 10:40:14 +02:00

131 lines
4.4 KiB
PHP

<?php
/*
Template Name: Page Press
*/
?>
<?php
global $tp;
get_header();
$description = get_field('description');
$form = get_field('contact_form');
?>
<div class="page-press">
<?php get_template_part('partials/hero'); ?>
<!-- TODO : breadcrumbs fix -->
<?php get_template_part('partials/breadcrumbs'); ?>
<?php if(!empty($description)) : ?>
<div class="page-press-description fw fw-container">
<div class="page-press-description__wrapper wrapper description">
<?php echo $description; ?>
</div>
</div>
<?php endif; ?>
<?php
$category = 'press';
?>
<div class="posts filter-posts">
<div class="filter fw" data-posts="#<?php echo $category ?>" data-list="list-item-press" data-limit="6">
<div class="filter__wrapper wrapper">
<div class="filter-menu">
<div class="filter__select-wrap filter-select-wrap">
<ul class="filter-select">
<li>
<a title="Afficher">Afficher</a>
<?php tags_filter($category) ?>
</li>
</ul>
<div class="filter-results-num">
Résultat : <span class="filter-results-num__wrap"><span class="filter-results-num__current"></span> documents sur <span class="filter-results-num__total"></span></span>
</div>
</div>
</div>
<div class="active-filters">
<div class="active-filters__list"></div>
<div class="active-filters__clear-wrap">
<div class="active-filters__item active-filters__item_clear"><a class="active-filters__item-remove clear-all" data-category="<?php echo $category ?>" title="Effacer les filtres">&#10006;</a> Effacer les filtres</div>
</div>
</div>
</div>
</div>
<div class="posts-list fw fw-container no-top-padding">
<div class="posts-list__wrapper wrapper">
<div class="list-items posts-container" id="posts-container">
<?php echo do_shortcode('[ajax_load_more theme_repeater="list-item-press" id="press" category="'.$category.'" loading_style="infinite fading-circles" post_type="post" posts_per_page="6" max_pages="1" scroll="true" button_label="Voir plus de ressources documentaires" nester="true"]') ?>
</div>
</div>
</div>
</div>
<?php if(!empty($form) && !empty($form['form_shortcode'])) : ?>
<div id="page-press-form">
<div class="page-press-form fw fw-container gray-bg">
<div class="page-press-form__wrapper wrapper">
<?php if(!empty($form['title']) || !empty($form['subtitle']['text'])) : ?>
<h2 class="page-press-form__title textblock__title title">
<?php if(!empty($form['title'])) : ?>
<span class="title-text"><?php echo $form['title']; ?></span>
<?php endif; ?>
<?php if(!empty($form['subtitle'])) : ?>
<span class="page-press-form__subtitle subtitle-text textblock__subtitle subtitle subtitle_paint"><?php echo $form['subtitle']; ?></span>
<?php endif; ?>
</h2>
<?php endif; ?>
<div class="fw-container no-bottom-padding">
<?php echo do_shortcode($form['form_shortcode']); ?>
</div>
</div>
</div>
</div>
<?php endif; ?>
<?php
/* set_query_var('text_block', $satisfy['text_block']);
get_template_part('partials/text-block');*/
?>
</div>
<script type="text/javascript">
//$(document).find("select").val($("select option:first").attr('disabled', 'disabled'));
//$(document).find('option:first').addClass('highlight');
$('.page-press-form').find("select option:first").addClass('disabled').attr('disabled', 'disabled');
var _select = $('.page-press-form').find("select");
_select.change(function(){
_select.addClass('changed');
});
if(window.location.hash) {
var hash = window.location.hash;
window.almComplete = function(alm){
console.log('sss');
setTimeout(function(){
var hh = $(document).find('.header').outerHeight();
$('html, body').animate({
scrollTop: $(hash).offset().top
}, 1, 'swing');
}, 10);
};
}
</script>
<?php get_footer(); ?>