-
Notifications
You must be signed in to change notification settings - Fork 0
/
template-base.php
73 lines (67 loc) · 1.83 KB
/
template-base.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
/*
Template name: Base
*/
?>
<?php get_header(); ?>
<div class="container">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php
$args = array(
'post_type' => array( 'post' ),
'posts_per_page' => -1,
'facetwp' => true
);
$the_query = new WP_Query( $args );
?>
<?php if ( $the_query->have_posts() ) { ?>
<div class="flex flex-wrap gap-10 p-4 border-2 border-gray-400">
<div>
<h4>Checkboxes</h4>
<?php echo facetwp_display('facet','cat_checkboxes'); ?>
</div>
<div class="flex flex-col gap-y-4">
<h4>Select</h4>
<?php echo facetwp_display('facet','cat_select'); ?>
<select name="" id="">
<option value="">Normal select</option>
<option value="option_1">Option 1</option>
<option value="option_2">Option 2</option>
<option value="option_3">Option 3</option>
</select>
</div>
<div>
<h4>FSelect</h4>
<?php echo facetwp_display('facet','cat_fselect'); ?>
</div>
<div>
<h4>Radios</h4>
<?php echo facetwp_display('facet','cat_radio'); ?>
</div>
<div>
<h4>Dates</h4>
<?php echo facetwp_display('facet','cat_dates'); ?>
</div>
<div>
<h4>Search</h4>
<?php echo facetwp_display('facet','search'); ?>
</div>
<div>
<?php echo facetwp_display('facet','reset'); ?>
</div>
</div>
<div class="grid grid-cols-4 gap-4 mt-10">
<?php while ( $the_query->have_posts() ) { $the_query->the_post(); ?>
<a href="#" class="p-4 border border-gray-300">
<h3><?php the_title() ?></h3>
</a>
<?php } ?>
</div>
<?php } wp_reset_postdata(); ?>
<?php get_template_part('template-parts/content', get_post_format()); ?>
<?php endwhile; ?>
<?php endif; ?>
</div>
<?php
get_footer();