Initial commit
This commit is contained in:
28
templates/about.php
Normal file
28
templates/about.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/*
|
||||
Template Name: Шаблон страницы о проекте
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
||||
|
||||
<div class="content-middle articles-wrapper">
|
||||
<?php get_template_part('partials/rubrics-mobile'); ?>
|
||||
<div class="section-title about-section-title">
|
||||
<h1 class="section-title__title"><?= the_title() ?></h1>
|
||||
</div>
|
||||
|
||||
<div class="about">
|
||||
<?= get_template_part('content-about')?>
|
||||
</div>
|
||||
<a href="<?= home_url()?>" class="articles-preview__show-next subsctiption-back">На главную</a>
|
||||
<div class="grid">
|
||||
<div class="grid__item"></div>
|
||||
<div class="grid__item"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
get_footer(); ?>
|
||||
27
templates/advertisers.php
Normal file
27
templates/advertisers.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/*
|
||||
Template Name: Шаблон страницы рекламодателей
|
||||
*/
|
||||
|
||||
$advertisers = get_post_query('advertiser', 10, 'ASC', '');
|
||||
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
<div class="content-middle articles-wrapper">
|
||||
<?php get_template_part('partials/rubrics-mobile'); ?>
|
||||
<div class="section-title">
|
||||
<h1 class="section-title__title"><?= the_title() ?></h1>
|
||||
</div>
|
||||
<div class="articles-preview">
|
||||
<? get_template_part('content-advertiser', null, ['advertiser' => $advertisers])?>
|
||||
</div>
|
||||
<a href="<?= home_url()?>" class="articles-preview__show-next">На главную</a>
|
||||
<div class="articles__spacer-container">
|
||||
<div class="articles__spacer"></div>
|
||||
<div class="articles__spacer"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
get_footer(); ?>
|
||||
121
templates/contacts.php
Normal file
121
templates/contacts.php
Normal file
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
/*
|
||||
Template Name: Шаблон страницы контакты
|
||||
*/
|
||||
?>
|
||||
<?php get_header(); ?>
|
||||
|
||||
<div class="content-middle articles-wrapper">
|
||||
<?php get_template_part('partials/rubrics-mobile'); ?>
|
||||
<div class="section-title border-top">
|
||||
<h1 class="section-title__title"><? the_title()?></h1>
|
||||
</div>
|
||||
<div class="articles-single">
|
||||
<div class="contacts__map-container">
|
||||
<div class="contacts__map" id="contacts_map"></div>
|
||||
</div>
|
||||
|
||||
<div class="contacts__container">
|
||||
<div class="contacts__text-block">
|
||||
<p class="contacts__block-title subtitle-13">Адрес</p>
|
||||
<p class="contacts__block-subtitle text-13"><?=get_field('address', 'option'); ?></p>
|
||||
</div>
|
||||
<div class="contacts__text-block">
|
||||
<p class="contacts__block-title subtitle-13">Телефон</p>
|
||||
<p class="contacts__block-subtitle text-13"><?=get_field('phone', 'option'); ?></p>
|
||||
</div>
|
||||
<div class="contacts__text-block">
|
||||
<p class="contacts__block-title subtitle-13">E-mail</p>
|
||||
<p class="contacts__block-email text-13"><?=get_field('email', 'option'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<? $privacyPolicy = get_field('privacy_policy', 'option'); ?>
|
||||
<div class="contacts__container">
|
||||
<h2 class="subtitle-18">Написать нам</h2>
|
||||
<?= do_shortcode('[contact-form-7 id="e39d3f5" title="Написать нам" html_class="contacts__form" html_id="contact__form"]')?>
|
||||
<p class="text-11"><?= $privacyPolicy['output_text']?></p>
|
||||
</div>
|
||||
</div>
|
||||
<a href="<?= home_url() ?>" class="articles-preview__show-next">На главную</a>
|
||||
<div class="articles__spacer-container">
|
||||
<div class="articles__spacer"></div>
|
||||
<div class="articles__spacer"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script async src="https://api-maps.yandex.ru/2.1/?lang=ru_RU&apikey=8f62a900-d60a-4059-887b-83fe5d19d0a5"
|
||||
type="text/javascript"></script>
|
||||
|
||||
<?php
|
||||
$params = get_field('yandex_params', 'option');
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
||||
const handleInit = () => {
|
||||
ymaps.ready(init);
|
||||
// Функция ymaps.ready() будет вызвана, когда
|
||||
// загрузятся все компоненты API, а также когда будет готово DOM-дерево.
|
||||
function init() {
|
||||
// Создание карты.
|
||||
var myMap = new ymaps.Map("contacts_map", {
|
||||
// Координаты центра карты.
|
||||
// Порядок по умолчанию: «широта, долгота».
|
||||
// Чтобы не определять координаты центра карты вручную,
|
||||
// воспользуйтесь инструментом Определение координат.
|
||||
center: [<?= $params['latitude']?>, <?= $params['longitude']?>],
|
||||
// Уровень масштабирования. Допустимые значения:
|
||||
// от 0 (весь мир) до 19.
|
||||
zoom: 17
|
||||
});
|
||||
|
||||
const Place = new ymaps.Placemark([<?= $params['latitude']?>, <?= $params['longitude']?>], {
|
||||
hintContent: '<?= $params['name_point']?>',
|
||||
balloonContent: '',
|
||||
balloonHeader: '',
|
||||
}, {
|
||||
iconLayout: 'default#image',
|
||||
iconImageHref: '<?= $params['image_point']['url']; ?>',
|
||||
iconImageSize: [36, 44],
|
||||
iconShape: {
|
||||
type: 'Rectangle',
|
||||
coordinates: [
|
||||
[-30, -93],
|
||||
[30, 0]
|
||||
]
|
||||
}
|
||||
});
|
||||
myMap.geoObjects.add(Place)
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
if (typeof ymaps !== 'undefined') {
|
||||
handleInit();
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
handleInit();
|
||||
}, 1000)
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
</script>
|
||||
<script>
|
||||
function handleSubmit() {
|
||||
|
||||
let wpcfForm = document.querySelector( '.wpcf7' );
|
||||
|
||||
wpcfForm.addEventListener( 'wpcf7submit', function( event ) {
|
||||
var inputs = event.detail.inputs;
|
||||
for ( var i = 0; i < inputs.length; i++ ) {
|
||||
if(inputs[i].value === '') return;
|
||||
}
|
||||
}, false );
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const form = document.getElementById('contact__form')
|
||||
form.addEventListener('submit', handleSubmit)
|
||||
});
|
||||
|
||||
</script>
|
||||
<?php get_footer(); ?>
|
||||
28
templates/materials.php
Normal file
28
templates/materials.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/*
|
||||
Template Name: Шаблон страницы материалы
|
||||
*/
|
||||
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
<div class="content-middle articles-wrapper">
|
||||
<?php get_template_part('partials/rubrics-mobile'); ?>
|
||||
<div class="section-title desktop">
|
||||
<h1 class="section-title__title">Материалы</h1>
|
||||
</div>
|
||||
<div class="articles-preview">
|
||||
<?php
|
||||
$paged = (get_query_var('paged')) ? absint(get_query_var('paged')) : 1;
|
||||
$args = array(
|
||||
'post_type' => 'post',
|
||||
'posts_per_page' => 10,
|
||||
'paged' => $paged
|
||||
);
|
||||
$query = new WP_Query($args);
|
||||
?>
|
||||
<?php get_template_part('partials/post-list', null, ['query' => $query, 'large_first_image' => false]); ?>
|
||||
</div>
|
||||
<?php custom_pagination($query); ?>
|
||||
</div>
|
||||
<?php get_footer(); ?>
|
||||
39
templates/partners.php
Normal file
39
templates/partners.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/*
|
||||
Template Name: Шаблон страницы партнёров
|
||||
*/
|
||||
|
||||
$partners = get_post_query('partners', 10, 'DESC', '');
|
||||
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
<div class="content-middle articles-wrapper">
|
||||
<?php get_template_part('partials/rubrics-mobile'); ?>
|
||||
<div class="section-title">
|
||||
<h1 class="section-title__title"><?= the_title() ?></h1>
|
||||
</div>
|
||||
<div class="articles-preview">
|
||||
<?
|
||||
if ($partners->have_posts()) :
|
||||
while ($partners->have_posts()) :
|
||||
$partners->the_post();
|
||||
?>
|
||||
<a href="<?= get_permalink(); ?>" class="partner-item">
|
||||
<div class="partner-item__image-container">
|
||||
<?= show_post_image(); ?>
|
||||
</div>
|
||||
<div class="partner-item__text-container">
|
||||
<p class="subtitle-16"><?= get_the_title(); ?></p>
|
||||
</div>
|
||||
</a>
|
||||
<?php
|
||||
endwhile;
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
<? custom_pagination($partners); ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
get_footer(); ?>
|
||||
71
templates/subscribetonews.php
Normal file
71
templates/subscribetonews.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/*
|
||||
Template Name: Шаблон страницы подписка на новости
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php get_header();?>
|
||||
|
||||
<div class="content-middle articles-wrapper">
|
||||
<?php get_template_part('partials/rubrics-mobile'); ?>
|
||||
<div class="section-title subscription-section-title">
|
||||
<h1 class="section-title__title"><?=the_title()?></h1>
|
||||
</div>
|
||||
<div class="subscription-form">
|
||||
<div class="subscription-form__bg">
|
||||
<img src="<?= get_asset('/images/subscription_bg.png')?>" alt="" />
|
||||
<img src="<?= get_asset('/images/subscription_bg_sm.png')?>" alt="" />
|
||||
</div>
|
||||
<p class="subscription-form__title"><?the_content()?></p>
|
||||
<p class="subscription-form__subtitle">Выбор необходимых рубрик для подписки:</p>
|
||||
<div class="subscription-form__options">
|
||||
<?
|
||||
$arg_cat = array(
|
||||
'exclude' => '17,20, 21',
|
||||
'order' => 'ASC',
|
||||
'taxonomy' => 'category',
|
||||
'hide_empty' => false
|
||||
);
|
||||
$categories = get_categories($arg_cat);
|
||||
|
||||
|
||||
$firstElement = array_shift($categories);
|
||||
array_push($categories, $firstElement);
|
||||
foreach ($categories ?? [] as $key => $cat) {
|
||||
if ($cat->slug === 'uncategorized') continue;
|
||||
?>
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="<?=$cat->slug?>" form="custom_form" class="checkbox__input"/>
|
||||
<div class="checkbox__inner">
|
||||
<div class="checkbox__check">
|
||||
<img src="<?= get_asset('/icons/check.svg');?>" alt="#" />
|
||||
</div>
|
||||
<span><?=$cat->name?></span>
|
||||
</div>
|
||||
</label>
|
||||
<? } ?>
|
||||
</div>
|
||||
<?= do_shortcode('[contact-form-7 id="0ddb83c" title="Форма подписки" html_class="" html_id="custom_form"]')?>
|
||||
<? $privacyPolicy = get_field('privacy_policy', 'option'); ?>
|
||||
<p class="subscription-form__policy"><?= $privacyPolicy['output_text']?></p>
|
||||
</div>
|
||||
|
||||
<a href="<?=home_url()?>" class="articles-preview__show-next subsctiption-back">На главную</a>
|
||||
<div class="grid">
|
||||
<div class="grid__item"></div>
|
||||
<div class="grid__item"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.subscribe-form__btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
width: 275px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<?php get_footer();?>
|
||||
|
||||
Reference in New Issue
Block a user