-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfront-page.php
36 lines (30 loc) · 1.12 KB
/
front-page.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
$options = MAKEIT::get_options();
$context = Timber::get_context();
if(isset($options['home']) && isset($options['home']['slider'])):
$context['home_slides'] = Timber::get_posts([
'post_type' => 'slide',
'posts_per_page' => intval($options['home']['slider']['count']) > 0 ? intval($options['home']['slider']['count']) : -1,
'orderby' => isset($options['home']['slider']['orderby']) ? $options['home']['slider']['orderby'] : 'date',
'tax_query' => [
[
'taxonomy' => 'type',
'field' => 'term_id',
'terms' => intval($options['home']['slider']['type']),
]
]
], 'Awesome_Slide');
endif;
$context['posts'] = Timber::get_posts([
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => 8
]);
// Portfolio
$context['portfolio'] = Timber::get_posts([
'post_type' => 'portfolio',
'post_status' => 'publish',
'orderby' => 'menu_order',
], 'Awesome_Portfolio');
// !Kint::dump( $context['portfolio'] ); die();
Timber::render( 'pages/home.twig', $context );