| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template archive docs |
| 4 |
* |
| 5 |
* @link https://wpdeveloper.net |
| 6 |
* @since 1.0.0 |
| 7 |
* |
| 8 |
* @package BetterDocs |
| 9 |
* @subpackage BetterDocs/public |
| 10 |
*/ |
| 11 |
|
| 12 |
get_header(); |
| 13 |
|
| 14 |
$object = get_queried_object(); |
| 15 |
?> |
| 16 |
|
| 17 |
<div class="betterdocs-category-wraper betterdocs-single-wraper"> |
| 18 |
<?php |
| 19 |
$live_search = BetterDocs_DB::get_settings('live_search'); |
| 20 |
if($live_search == 1){ |
| 21 |
?> |
| 22 |
<div class="betterdocs-search-form-wrap"> |
| 23 |
<?php echo do_shortcode( '[betterdocs_search_form]' ); ?> |
| 24 |
</div> |
| 25 |
<?php } ?> |
| 26 |
<div class="betterdocs-content-area"> |
| 27 |
<aside id="betterdocs-sidebar"> |
| 28 |
<div class="betterdocs-sidebar-content betterdocs-category-sidebar"> |
| 29 |
<?php |
| 30 |
echo do_shortcode( '[betterdocs_category_grid]' ); |
| 31 |
?> |
| 32 |
</div> |
| 33 |
</aside><!-- #sidebar --> |
| 34 |
<div id="main" class="docs-listing-main"> |
| 35 |
<div class="docs-category-listing" > |
| 36 |
<div class="docs-cat-title"> |
| 37 |
<?php printf( '<h3>%s </h3>', $object->name ); ?> |
| 38 |
</div> |
| 39 |
<div class="docs-list"> |
| 40 |
<?php |
| 41 |
$args = array( |
| 42 |
'post_type' => 'docs', |
| 43 |
'posts_per_page' => -1, |
| 44 |
'tax_query' => array( |
| 45 |
array( |
| 46 |
'taxonomy' => 'doc_tag', |
| 47 |
'field' => 'slug', |
| 48 |
'terms' => $object->slug, |
| 49 |
), |
| 50 |
), |
| 51 |
); |
| 52 |
$post_query = new WP_Query( $args ); |
| 53 |
|
| 54 |
if ( $post_query -> have_posts() ) : |
| 55 |
|
| 56 |
echo '<ul>'; |
| 57 |
while ( $post_query -> have_posts() ) : $post_query -> the_post(); |
| 58 |
echo '<li><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" width="0.86em" height="1em" style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);" preserveAspectRatio="xMidYMid meet" viewBox="0 0 1536 1792"><path d="M1468 380q28 28 48 76t20 88v1152q0 40-28 68t-68 28H96q-40 0-68-28t-28-68V96q0-40 28-68T96 0h896q40 0 88 20t76 48zm-444-244v376h376q-10-29-22-41l-313-313q-12-12-41-22zm384 1528V640H992q-40 0-68-28t-28-68V128H128v1536h1280zM384 800q0-14 9-23t23-9h704q14 0 23 9t9 23v64q0 14-9 23t-23 9H416q-14 0-23-9t-9-23v-64zm736 224q14 0 23 9t9 23v64q0 14-9 23t-23 9H416q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h704zm0 256q14 0 23 9t9 23v64q0 14-9 23t-23 9H416q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h704z"/></svg><a href="'.get_the_permalink().'">'.get_the_title().'</a></li>'; |
| 59 |
endwhile; |
| 60 |
|
| 61 |
echo '</ul>'; |
| 62 |
|
| 63 |
else : |
| 64 |
|
| 65 |
echo '<p class="nothing-here">'.esc_html__( 'Sorry, no docs were found.', 'betterdocs' ).'</p>'; |
| 66 |
|
| 67 |
endif; |
| 68 |
|
| 69 |
?> |
| 70 |
</div> |
| 71 |
</div> |
| 72 |
</div> |
| 73 |
</div> |
| 74 |
</div> |
| 75 |
|
| 76 |
<?php |
| 77 |
get_footer(); |
| 78 |
|