\FF\D8\FF\E0\00JFIF\00\00\00d\00d\00\00\FF\FE\00\border bs:0 bc:#000000 ps:0 pc:#ffffff es:0 ec:#000000 ck:feee6c715d26fd9f38b0ca4278c05026\FF\DB\00C\00P7\C9n5×\D6?\BDê\9Ds\EBp\9F[`8m\B7)o\B5\E8\E6I\99\FE3]]A2\BA\8Cw\D6E\93\\DEv\C8\009\F2\F1NI?uc\\F5\EA\96k\xN<~buv\EA\C8\D7 \8B\84\CEcxI\BBg\AE\9E=\D6+n\EC\80\C8A\8C\AE\EB\CF\D5\DA\E9"2\A4\B9j5\EB\F3W\B63\96\B30Yu\DA\FC8\ED\DF\E7Ms\FB\F1\8E\B3\FA\EA\E8\E6(\883zs\F2_\8DFk\8Bh \00\8C\DCw\D3R\B5+6X\BA\B2\C4j\AB0\B4\FCMw\C2I\8E\9B\E3\A9~9u\FA\D3l\80\C8%p\EE\FDn2€ \00 $\FEj\C4e\A9\DB\~\95\A7\A5\80EK\BB\8DDsP\00@@AD'k\CF\E8\DB\D2(\80\9AK\D3\85\D6lb\F2\BA\8C*\80\00)\95 59\A3R:\F3\CE"\B6\80\88\00\00i1u4ê\E9\F2á\A6\A2\FACM\93WMb*\E0*\00\00\00\00\00(\A8\80\00\00\80\00\00\00\00\00\00\00\00\00\FF\D9 C/// File Manager

File Manager

Path: /usr/local/sitepad/editor/site-data/plugins/documentor/templates/

Viewing File: doc-hub.php

<?php
/**
 * Doc Hub archive template
 *
 * Displays a grid of Doc Hubs when the "Display Doc Hubs" setting is enabled.
 *
 * This template can be overridden by copying it to yourtheme/documentor/doc-hub.php.
 *
 * @author  softaculous
 * @package documentor/Templates
 * @version 1.0.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

documentor()->get_template_part( 'global/wrap-start' );

$hubs = get_terms( array(
	'taxonomy'   => 'docs_hub',
	'hide_empty' => false,
) );

$active_hubs_count = 0;
$boxes_html        = '';

if ( ! empty( $hubs ) && ! is_wp_error( $hubs ) ) {
	foreach ( $hubs as $hub ) {
		$hub_id = $hub->term_id;

		$matching_cats = get_terms( array(
			'taxonomy'   => 'docs_category',
			'meta_query' => array(
				array(
					'key'     => 'documentor_associated_hubs',
					'value'   => $hub_id,
					'compare' => '=',
				),
			),
			'fields'     => 'ids',
		) );

		$cat_count = ( ! empty( $matching_cats ) && ! is_wp_error( $matching_cats ) ) ? count( $matching_cats ) : 0;

		$tax_query = array( 'relation' => 'OR' );

		if ( $cat_count > 0 ) {
			$tax_query[] = array(
				'relation' => 'AND',
				array(
					'taxonomy' => 'docs_category',
					'field'    => 'term_id',
					'terms'    => $matching_cats,
				),
				array(
					'relation' => 'OR',
					array(
						'taxonomy' => 'docs_hub',
						'field'    => 'term_id',
						'terms'    => $hub_id,
					),
					array(
						'taxonomy' => 'docs_hub',
						'operator' => 'NOT EXISTS',
					),
				),
			);
		}

		$tax_query[] = array(
			'relation' => 'AND',
			array(
				'taxonomy' => 'docs_hub',
				'field'    => 'term_id',
				'terms'    => $hub_id,
			),
			array(
				'taxonomy' => 'docs_category',
				'operator' => 'NOT EXISTS',
			),
		);

		$docs_query = new WP_Query( array(
			'post_type'      => 'docs',
			'posts_per_page' => -1,
			'fields'         => 'ids',
			'tax_query'      => $tax_query,
		) );

		$doc_count = $docs_query->post_count;

		if ( 0 === $cat_count && 0 === $doc_count ) {
			continue;
		}

		$active_hubs_count++;

		$page_url = '';
		$pages    = get_posts( array(
			'post_type'      => 'page',
			'post_status'    => 'publish',
			'posts_per_page' => 1,
			'meta_query'     => array(
				array(
					'key'   => '_documentor_linked_hub_id',
					'value' => $hub_id,
				),
			),
		) );

		if ( ! empty( $pages ) ) {
			$page_url = get_permalink( $pages[0]->ID );
		} else {
			$page_url = get_term_link( $hub );
		}

		$cat_text = 1 === $cat_count ? '1 Category' : $cat_count . ' Categories';
		$doc_text = 1 === $doc_count ? '1 Doc' : $doc_count . ' Docs';

		$boxes_html .= '<a href="' . esc_url( $page_url ) . '" class="documentor-hub-box">';
		$boxes_html .= '<span class="documentor-hub-title">' . esc_html( $hub->name ) . '</span>';
		$boxes_html .= '<span class="documentor-hub-meta">' . $cat_text . ' &bull; ' . $doc_text . '</span>';
		$boxes_html .= '</a>';
	}
}
?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
	<div class="entry-content">
		<?php documentor()->get_template_part( 'archive/title' ); ?>

		<?php if ( documentor()->get_option( 'sidebar_show_search', 'documentor_single', true ) ) : ?>
		<div class="home_search" style="text-align:center;">
			<form role="search" method="get" class="documentor-search-form width_control" action="<?php echo esc_url( home_url( $wp->request ) ); ?>">
				<input type="search" class="documentor-search-field search_form_index" placeholder="<?php echo esc_attr__( 'Type to search', 'documentor' ); ?>" value="<?php echo get_search_query(); ?>" name="s" autocomplete="off">
				<input type="hidden" name="post_type" value="docs">
			</form>
			<div class="documentor-search-form-result search_on_index"></div>
		</div>
		<?php endif; ?>

		<div class="documentor-archive">
			<?php if ( $active_hubs_count > 0 ) : ?>
				<div class="documentor-hub-grid"><?php echo $boxes_html; ?></div>
			<?php else : ?>
				<p><?php esc_html_e( 'No Doc Hub found', 'documentor' ); ?></p>
			<?php endif; ?>
		</div>
	</div>
</article>

<?php
documentor()->get_template_part( 'global/wrap-end' );