Sindbad~EG File Manager

Current Path : /var/www/product/wp-content/themes/flatbase-child/
Upload File :
Current File : /var/www/product/wp-content/themes/flatbase-child/template-ebooks.php

<?php
/*
 * Template Name: E-Book
 */

if (!defined('WPINC')) {

    die;
}
get_header();

$term = get_term_by('slug', get_query_var('ebooks'), 'ebooks');
$arg = array(
    'hierarchical' => 1,
    'show_option_none' => '',
    'hide_empty' => 0,
    'parent' => $term->term_id,
    'taxonomy' => 'ebooks'
);
$categories = get_categories($arg);
$category_name = $categories[0]->name;
$category_desc = $categories[0]->description;
?>
<!-- BEGIN #content -->
<section class="cat_desc">
    <div class="cat_desc_heading">
        <?php echo $category_name; ?>
    </div>
    <div class="cat_desc_text">
        <p><?php echo $category_desc; ?></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="&#xf002;" />
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </header>
    <div class="nice-knowledgebase clearfix">
        <div class="row clearfix article-index">
            <div class="ebook-canvas">
            <?php 
            global $post;
            $args = array( 'post_type' => 'ebook', 'posts_per_page' => -1,'order' => 'ASC' );
            $loop = new WP_Query( $args );
            while ( $loop->have_posts() ) : $loop->the_post(); ?>
                <div class="columns-3">
                    <div class="ebook-image">
                        <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
                        <img src="<?php echo $image[0]; ?>" />
                    </div>
                    <div class="ebook-title">
                        <?php the_content(); ?>
                    </div>
                    <div class="ebook-download">
                        <?php
                        $ebooks = get_post_meta( $post->ID, 'wp_custom_attachment', true );
                        if (is_array($ebooks) && $ebooks['url'] != '') {
                            $href = $ebooks['url']; ?>
                            <a download href="<?php echo $href; ?>" class="ebook-download-btn"> Download </a>
                        <?php } ?>
                    </div>
                </div>
            <?php endwhile;
            ?>
            </div>
        </div>
    </div>
    <!-- END #content -->
</section>
<?php
get_footer();

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists