HEX
Server: nginx/1.15.10
System: Linux vps240vn 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User: www (1000)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/vietktv.vn/wp-content/themes/binhvu/archive.php
<?php get_header(); 
$post_type = 'post';
$taxonomy = 'category'; 
$current_term_id = get_queried_object_id();
$term = get_term((int)$current_term_id, $taxonomy); ?>

<?php require_once(TEMPLATEPATH . '/inc/content-main-header.php'); ?>

<div class="block-breakcrumb">
    <div class="container">
        <?php if ( function_exists('yoast_breadcrumb') ){yoast_breadcrumb('','');} ?>
    </div>
</div><!-- end .block-breakcrumb  -->

<div class="sub-wrap block-item">
    <div class="container">
        <div class="primary fright">
            <h1 class="archive-head tf">
                <?php echo $term->name; ?>
            </h1>
            <div class="archive-wrap block-item-content-flex">
                <?php
                $current = isset($_GET['trang']) ? intval($_GET['trang']) : 1;
                $record_per_page = 12;
                $offset = ( $current - 1 ) * $record_per_page;
                $total = ceil(wp_count_posts($post_type)->publish / $record_per_page);
                $args = array(
                    'post_type' => $post_type,
                    'posts_per_page' => $record_per_page,
                    'page' => $current,
                    'offset' => $offset,
                    'tax_query' => array(
                        array(
                            'taxonomy' => $taxonomy,
                            'field'    => 'id',
                            'terms'    => $current_term_id,
                        ),
                    ),
                );
                $tax_query = new WP_Query($args);
                if($tax_query->have_posts()): while($tax_query->have_posts()) : $tax_query->the_post(); ?> 
                    <div class="archive-du-an-item home-new-item fleft">
                        <a class="home-new-item-thumb thumb-cover item-thumbnail" href="<?php the_permalink(); ?>">
                            <?php if(has_post_thumbnail()){the_post_thumbnail('full'); }else{ echo '<img src="images/thumb/placeholder.png" alt="not avaiable" title="not avaiable"/>'; } ?>
                            <div class="thumbnail-hoverlay main-color-1-bg"></div>
                            <div class='thumbnail-hoverlay-icon'><i class="fal fa-search"></i></div>
                        </a>
                        <div class="home-new-item-info">
                            <h2 class="home-new-item-title">
                                <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
                            </h2>
                            <div class="home-new-item-date-comment">
                                <span><i class="far fa-calendar"></i><?php the_time('d/m/Y'); ?></span>
                                <span><i class="far fa-comments-alt"></i>0 Bình luận</span>
                            </div>
                            <div class="home-new-item-des">
                                <?php echo wp_trim_words(get_the_excerpt(), 25, '...'); ?>
                            </div>
                        </div>
                    </div>
                <?php endwhile;  wp_reset_postdata(); else: ?>
                    <p class="empty-content">Bài viết đang cập nhật ...</p>
                <?php endif; ?>
                <div class="cboth"></div>
            </div>
            <div class="pagination">
                <?php
                $big = 999999999;
                echo paginate_links(array(
                    'base' => @add_query_arg('trang', '%#%'),
                    'format' => '?paged=%#%',
                    'current' =>  $current,
                    'total' => $tax_query->max_num_pages,
                    'prev_text' => __('&laquo;'),
                    'next_text' => __('&raquo;'),
                    'mid_size' => 5
                )); ?>
            </div>
        </div><!-- end .primary -->
        <?php get_sidebar('post'); ?>
        <div class="cboth"></div>
    </div><!-- end .container -->
</div><!-- end .block-item-->

<?php get_footer(); ?>