add graduation packet

This commit is contained in:
Sergey Krylov 2021-03-21 00:19:18 +03:00
parent 4114e9f400
commit 83f8350f52
2 changed files with 61 additions and 22 deletions

View File

@ -6,28 +6,39 @@
</div> </div>
<div class="row packets center"> <div class="row packets center">
<div class="col-4 packet">
<?php hm_get_template_part('parts/landings/graduation/offer-packet', array(
'title' => 'Базовый',
'price' => 900,
'description' => ['1 квест', '3 часа лофта', 'Украшение шарами', 'Аниматор', 'Диплом выпускника', '2 проститутки', '3 грамма кокаина и гашиша']
)); ?>
</div>
<div class="col-4 packet">
<?php hm_get_template_part('parts/landings/graduation/offer-packet', array(
'title' => 'Стандарт',
'price' => 1390,
'description' => ['2 квест', '3 часа лофта', 'Украшение шарами', 'Аниматор', 'Диплом выпускника']
)); ?>
</div>
<div class="col-4 packet">
<?php hm_get_template_part('parts/landings/graduation/offer-packet', array( <?php
'title' => 'VIP', $posts = get_posts( array(
'price' => 2490, 'category' => 0,
'description' => ['2 квест', '3 часа лофта', 'Украшение шарами', 'Аниматор', 'Диплом выпускника'] 'orderby' => 'date',
)); ?> 'order' => 'ASC',
</div> 'include' => array(),
'exclude' => array(),
'meta_key' => '',
'meta_value' =>'',
'post_type' => 'armanty_graduation',
'posts_per_page' => 3,
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
) );
foreach( $posts as $post ){
setup_postdata($post);?>
<div class="col-4 packet">
<?php
$composition = get_field('graduation_offer_composition');
$arr = [];
foreach ($composition as $point => $value) {
$arr[] = $value['point'];
}
hm_get_template_part('parts/landings/graduation/offer-packet', array(
'title' => get_the_title(),
'price' => get_field('graduation_offer_price'),'description' => $arr
));
?>
</div>
<?php
}
?>
</div> </div>
</div> </div>
</section> </section>

View File

@ -142,7 +142,7 @@
'hierarchical' => false, 'hierarchical' => false,
'menu_position' => 2, 'menu_position' => 2,
'menu_icon' => 'dashicons-tickets-alt', 'menu_icon' => 'dashicons-tickets-alt',
'supports' => array('thumbnail') 'supports' => array('title', 'thumbnail')
) ); ) );
register_post_type('armanty_feedback', array( register_post_type('armanty_feedback', array(
@ -202,6 +202,34 @@
'menu_icon' => 'dashicons-businesswoman', 'menu_icon' => 'dashicons-businesswoman',
'supports' => array('title', 'thumbnail') 'supports' => array('title', 'thumbnail')
) ); ) );
register_post_type('armanty_graduation', array(
'labels' => array(
'name' => 'Выпускные пакеты', // Основное название типа записи
'singular_name' => 'Выпускной пакет', // отдельное название записи типа Book
'add_new' => 'Добавить новый',
'add_new_item' => 'Добавить новый пакет',
'edit_item' => 'Редактировать пакет',
'new_item' => 'Новый пакет',
'view_item' => 'Посмотреть пакет',
'search_items' => 'Найти пакет',
'not_found' => 'Пакетов не найдено',
'not_found_in_trash' => 'В корзине пакетных предложений не найдено',
'parent_item_colon' => '',
'menu_name' => 'Выпускные &nbsp; пакеты'
),
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'has_archive' => 'true', // если нужна страница архива тут указываем её ярлык а не true
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => 2,
'menu_icon' => 'dashicons-tickets-alt',
'supports' => array('title')
) );
} }
?> ?>