HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux vmi1674223.contaboserver.net 5.4.0-182-generic #202-Ubuntu SMP Fri Apr 26 12:29:36 UTC 2024 x86_64
User: root (0)
PHP: 7.4.3-4ubuntu2.22
Disabled: 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_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/onlineshop/wp-content/themes/nautica/vc_templates/engo_categorytabpost.php
<?php
global $thumbsize;
$grid_link = $grid_layout_mode = $title = $filter = '';
$posts = array();
$atts = vc_map_get_attributes($this->getShortcode(), $atts);
extract($atts);


$query_string = str_replace('|', '&', $atts['loop']);
$query_string = str_replace(':', '=', $query_string);
$query_string = str_replace('size', 'posts_per_page', $query_string);

parse_str($query_string, $query_array);


if (is_front_page()) {
    $paged = (get_query_var('page')) ? get_query_var('page') : 1;
} else {
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
}
$query_array['paged'] = $paged;
$post_per_page = $query_array['posts_per_page'];

$loop = new WP_Query($query_array);
?>

    <section
            class="widget frontpage-posts section-blog widget-style  <?php echo(($el_class != '') ? ' ' . esc_attr($el_class) : ''); ?>">
        <?php
        if ($title != '') { ?>
            <h3 class="widget-title visual-title <?php echo esc_attr($size) . ' ' . esc_attr($alignment); ?>">
                <span><?php echo esc_attr($title); ?></span>
            </h3>
        <?php }
        ?>
        <div class="widget-content">
            <?php if (empty($args['cat'])) { ?>
                <?php esc_html_e('Please select category or more to show posts and the navigator', 'nautica'); ?>
                <?php
            } else {

                $loop = new WP_Query($query_array);
                $_count = 1;
                $colums = '3';
                $bscol = floor(12 / $colums);
                $end = $loop->post_count;
                ?>
                <div class="frontpage-wrapper">

                    <div class="categories-nav">
                        <ul class="list-inline">
                            <?php foreach (explode(",", $args['cat']) as $catid) {
                                $name = get_cat_name($catid); ?>
                                <li><a href="<?php echo esc_url(get_category_link($catid)); ?>"
                                       title="<?php echo esc_attr($name); ?>"><?php echo esc_attr($name); ?></a></li>
                            <?php } ?>
                        </ul>
                    </div>

                    <div class="row">
                        <?php
                        $i = 0;
                        $main = $num_mainpost;

                        while ($loop->have_posts()) {
                            $loop->the_post();
                            ?>
                            <?php if ($i <= $main - 1) { ?>
                                <?php if ($i == 0) { ?>
                                    <div  class="col-sm-12 main-posts">
                                <?php } ?>
                                <?php get_template_part('vc_templates/post/_single') ?>

                                <?php if ($i == $main - 1 || $i == $end - 1) { ?>
                                    </div>
                                <?php } ?>
                            <?php } else { ?>
                                <?php if ($i == $main) { ?>
                                    <div class="col-sm-12 secondary-posts">
                                <?php } ?>
                                <?php get_template_part('vc_templates/post/_single-v2') ?>
                                <?php if ($i == $end - 1) { ?>
                                    </div>
                                <?php } ?>
                            <?php } ?>
                            <?php $i++;
                        } ?>
                    </div>
                </div>
            <?php } ?>
        </div>
    </section>
<?php wp_reset_query(); ?>