File "category.php"

Full Path: /home/cabizcok/public_html/wp-content/themes/renax/category.php
File size: 4.48 KB
MIME-type: text/x-php
Charset: utf-8

<?php 
$renax_options = get_option('renax');
get_header();
?>
<!-- Header Banner -->
<?php 
$renax_term_id = get_queried_object_id();
$renax_image_ids = get_term_meta( $renax_term_id, 'renax_post_thumb', false );// Media fields are always multiple. ?>
<?php if ( ! empty( $renax_image_ids ) ) { ?>
<?php foreach ( $renax_image_ids as $renax_image_id ) {
$renax_image = RWMB_Image_Field::file_info( $renax_image_id, array( 'size' => 'full' ) ); ?>
<section class="banner-header section-padding bg-img" data-overlay-dark="6" data-background="<?php echo esc_url($renax_image['url']);?>">
<?php } ;?>
<?php } else { ?>
<section class="banner-header section-padding bg-img" data-overlay-dark="6" <?php if(!empty(Renax_AfterSetupTheme::return_thme_option('blog_background','url'))) { ?>data-background="<?php echo esc_url(Renax_AfterSetupTheme::return_thme_option('blog_background','url'));?>"<?php } ;?>>
<?php } ;?>
	<div class="v-middle">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <<?php renax_index_subtitle_tag();?> class="rx-df-page-banner-subtitle"><?php esc_html_e('Category','renax');?></<?php renax_index_subtitle_tag();?>>
					<<?php renax_index_title_tag();?> class="rx-df-page-banner-title"><?php single_cat_title( '', true ); ?></<?php renax_index_title_tag();?>>
                </div>
            </div>
        </div>
    </div>
</section>
<!-- divider line -->
<div class="line-vr-section"></div>
<!-- Blog -->
<section class="blog2 section-padding">
    <div class="container">
        <div class="row">
            <div class="<?php if ( is_active_sidebar( 'sidebar-1' ) ) { ?>col-lg-8 col-md-12 <?php if (Renax_AfterSetupTheme::return_thme_option('index_page_style_opt')=='st2'){ ?>order-md-last<?php } ;?> <?php } else { ?>col-md-12<?php } ;?>">
                <div class="row">
                    <?php global $post, $post_id;?>
					<?php while ( have_posts() ) : the_post();?>
					<div id="post-<?php the_ID(); ?>" <?php post_class('col-md-12'); ?>>
                        <div class="item">
                            <?php if (has_post_thumbnail( $post->ID ) ) { ?>
							<?php $renax_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), '' );?>
							<div class="post-img">
                                <a href="<?php the_permalink();?>"> <img src="<?php echo esc_url($renax_image[0]);?>" alt="<?php the_title_attribute ();?>"> </a>
                            </div>
							<?php } ;?>
                            <div class="post-cont"> 
								<?php if( has_category() ) { ?>
								<?php $renax_category = wp_get_post_terms($post->ID,'category');?>
								<?php foreach ($renax_category as $renax_item) { ?>
								<span class="category"><a href="<?php echo esc_url(get_category_link($renax_item->term_id));?>"><?php echo esc_html($renax_item->name . '  ');?></a></span> 
								<?php } } ;?>
								<span class="calendar"><a href="<?php the_permalink();?>"><?php the_time( get_option( 'date_format' ) ); ?></a></span>
								<h5><a href="<?php the_permalink();?>"><?php the_title();?></a></h5>
								<?php if( wp_link_pages('echo=0') ) { ?>
								<?php the_content();
								wp_link_pages( array(
									'before'      => '<div class="page-links">',
									'after'       => '</div>',
									'link_before' => '<span>',
									'link_after'  => '</span>',
									'pagelink'    => '%',
									'separator'   => '',
								) );
								?>
								<?php } else {  ?>
                                <?php the_excerpt();?>
								<?php } ;?>
								<a href="<?php the_permalink();?>" class="button-1"><?php esc_html_e('Read More','renax');?></a>
                            </div>
                        </div>
                    </div>
					<?php endwhile; ?>
					<?php wp_reset_postdata();?>
                </div>
                <!-- Pagination -->
                <?php if (function_exists("renax_pagination")) {
					renax_pagination($wp_query->max_num_pages);
				}; ?>
            </div>
            <?php if ( is_active_sidebar( 'sidebar-1' ) ) { ?>
            <div class="col-lg-4 col-md-12 <?php if (Renax_AfterSetupTheme::return_thme_option('index_page_style_opt')=='st2'){ ?>order-md-first<?php } ;?>">
                <div class="blog2-sidebar row">
                    <?php dynamic_sidebar( 'sidebar-1' ); ?>
                </div>
            </div>
			<?php } ;?>
        </div>
    </div>
</section>
<?php get_footer(); ?>