HEX
Server: Apache
System: Linux server1.panigaletech.com 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.30
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/captainschairit.com/wp-content/themes/captainschare/template-parts/all-press-releases.php
<?php
/**
 * Template Name: All Press Releases
 */
get_header();
$banner_section = get_field('banner_section');
?>
  <!-- Header -->
  <header class="masthead-inner" style="background-image: url(<?php echo $banner_section['background_image'] ?>)">
    <div class="container">
      <div class="row">
        <div class="col-sm-12 col-md-12 col-lg-8 offset-lg-2">
          <div class="intro-text text-center">
            <div class="intro-heading"><?php echo $banner_section['text'] ?></div>
          </div>
        </div>
      </div>
    </div>
  </header>

  <!-- Services -->
  <section class="page-section news-section news-slider">
    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args = array(
        'posts_per_page'   => 5,
        'orderby'          => 'date',
        'order'            => 'DESC',
        'post_type'        => 'cc-press-releases',
        'post_status'      => 'publish',
        'paged' => $paged,
        );
    $press_releases = new WP_Query( $args );
    //   echo '<pre>'; print_r ($press_releases); echo '</pre>'; ?>
    <div class="section-padding">
      <div class="container">
        <div class="row">
          <div class="col-12 col-lg-8">
            <div class="row mb-2">
              <div class="col-8 col-md-6">
                <h2 class="heading02"><?php echo get_the_title(); ?></h3>
              </div>
            </div>
            <!-- WP-Post Start -->
            <?php if ( $press_releases->have_posts() ) { ?>
              <div class="row press-list pt-5 pb-2">
                <?php 
                  while ( $press_releases->have_posts() ) : $press_releases->the_post();
                    $postid = get_the_ID(); ?>
                    <div class="col-12 mb-5">
                        <p class="text-uppercase color-gray-medium"><b><?php echo get_the_date('M d, Y', $postid); ?></b></p>
                        <h3 class="heading03">
                        <a href="<?php echo get_permalink($postid); ?>"><?php the_title(); ?></a>
                        </h3>
                    </div>
                  <?php
                  endwhile;
                ?>
              </div>
              <!-- Here Goes Pegination Start -->
              <div class="pagination-section">
                <ul class="pagination pull-right">
                  <?php
                  global $wp_query;
                  $big = 999999999;
                  $total_pages = $press_releases->max_num_pages;
                    //echo $total_pages;
                  if ($total_pages > 1){
                    $current_page = max(1, get_query_var('paged'));
                    $links = paginate_links(array(
                        'base' => get_pagenum_link(1) . '%_%',
                        'format' => 'page/%#%',
                        'current' => $current_page,
                        'total' => $total_pages,
                        'type'  => 'array',
                        'prev_text'    => __('<i class="fa fa-angle-double-left" aria-hidden="true"></i>'),
                        'next_text'    => __('<i class="fa fa-angle-double-right" aria-hidden="true"></i>')
                    ));
                    foreach ($links as $link) { ?>
                        <li class="page-item"><?php echo str_replace('page-numbers', 'page-link', $link); ?></li>
                    <?php 
                    }
                  } 
                    ?>
                </ul>
            </div>
              <!-- Here Goes Pegination End -->
              <?php
              wp_reset_postdata();
            } ?>
            <!-- WP-Post End -->
          </div>
        </div>
      </div>
    </div>
   
  </section>
<?php
get_footer();
?>