Sindbad~EG File Manager
<?php
/**
* Flatbase by NiceThemes.
*
* The template for displaying `help` taxonomy pages.
*
* @link http://codex.wordpress.org/Template_Hierarchy
*
* @package Flatbase
* @author NiceThemes <hello@nicethemes.com>
* @license GPL-2.0+
* @link https://nicethemes.com/product/flatbase
* @copyright 2017 NiceThemes
* @since 1.0.0
*/
// If this file is called directly, abort.
if (!defined('WPINC')) {
die;
}
get_header();
?>
<!-- BEGIN #content -->
<section class="cat_desc">
<div class="cat_desc_heading">
<?php echo single_cat_title(); ?>
</div>
<div class="cat_desc_text">
<p><?php echo category_description(); ?></p>
</div>
</section>
<section <?php nice_content_class('main-content'); ?> role="main">
<header>
<div class="headerSearch">
<div class="hbreadcrumb">
<?php echo custom_breadcrumbs(); ?>
</div>
<div class="hsearchform">
<div id="search-wrap">
<form role="search" method="get" id="searchform" class="clearfix" action="<?php echo home_url('/'); ?>" autocomplete="off">
<div class="input">
<label for="s"><?php echo apply_filters('nice_livesearch_label', __('Have a question? Ask or enter a search term.', 'nicethemes')); ?></label>
<input placeholder="Have a question? Ask or enter a search term." type="text" name="s" id="s" />
<input type="submit" id="searchsubmit" value="" />
</div>
</form>
</div>
</div>
</div>
</header>
<div class="nice-knowledgebase clearfix">
<div class="row clearfix article-index">
<?php
$term = get_term_by('slug', get_query_var('help'), 'help');
$arg = array(
'hierarchical' => 1,
'show_option_none' => '',
'hide_empty' => 0,
'parent' => $term->term_id,
'taxonomy' => 'help'
);
$categories = get_categories($arg);
if (!empty($categories)):
$count = 0;
foreach ($categories as $category) {
$category_id = $category->term_id;
$posts_array = array(
'showposts' => -1,
'post_type' => 'article',
'tax_query' => array(
array(
'taxonomy' => 'help',
'field' => term_id,
'terms' => $category_id,
)
)
);
$loop = new WP_Query($posts_array);
if ($loop->have_posts()) {
echo '<div class="columns-3"><header>';
echo '<h3><a href="#">' . $category->name . '</a></h3></header>';
echo '<ul class="category-posts">';
$i = 0;
while ($loop->have_posts()) : $loop->the_post();
$i++;
if ( $i > 4 ) {
$class = 'class="hide_it"';
} else {
$class = '';
}
?>
<li <?php echo $class; ?>><i class="fa fa-file-o"></i>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</li>
<?php
endwhile;
global $wp;
$current_url = home_url( $wp->request );
$get_cat = explode("/help/", $current_url);
$current_category = $get_cat[1];
if ($i >= 5) {
echo '<li> <a href="' . get_site_url() . '/article-sub-category?id=' . $category_id . '&category='. $current_category .'"> <strong class="moreTxt">more</strong> <img src="' . get_stylesheet_directory_uri() . '/images/more-btn.jpg"></a> </li>';
}
echo '</ul>';
echo '</div>';
} else {
echo '<div class="columns-3"></div>';
}
$count++;
//echo '<h1 class="monika">'.$category_id.'</h1>';
}
endif;
?>
</div>
</div>
<!-- END #content -->
</section>
<?php //get_sidebar(); ?>
<?php
get_footer();
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists