HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
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/tana/wp-content/themes/tana/page-templates/know-how.php
<?php
/*
* Template Name: Know How
*
*/
 ?>

 <?php
  if ( !is_ajax() ) :
  get_header();
  endif;

 $id = $_POST['page-id'];
?>

 <div class="container">
  <div class="row">
    <div class="col-xs-12">
      <div class="row">
        <div class="col-xs-6 col-xs-offset-3 col-sm-2 col-sm-offset-0 col-sm-18">
          <a href="<?= home_url() ?>">
            <?php
              $logo = get_field( 'page_logotype', $id );
              ?>
            <img class="logo--secondary img-responsive center-block" src="<?= $logo['url'] ?>" alt="<?= $logo['alt'] ?>">
          </a>
        </div>
      </div>
    </div>
  </div>
  <div class="row">
    <div class="col-sm-2 col-sm-18 sticky-follow">
      <div>
        <div>
          <a href="./">
            <img class="logo--secondary img-responsive center-block" src="<?= $logo['url'] ?>" alt="<?= $logo['alt'] ?>">
          </a>
        </div>
        <ul class="list list--unstyled list-categories list-categories--pretty">
          <?php
            $categories = get_terms( 'category' );
            foreach( $categories as $category ) :
              ?>
          <li class="list-categories__item" data-type="<?= $category->term_id ?>" data-category-name="<?= strtolower($category->name) ?>"><?= $category->name ?></li>
          <?php endforeach; ?>
          <li class="list-categories__item" data-type="links" data-category-name="links" href="#links-grid">Links</li>
        </ul>
      </div>
    </div>

    <div class="col-sm-10 col-sm-82">
      <div class="results-container">
        <div class="articles-grid">
          <div class="row">
            <div class="col-sm-6 col-md-8 faded">

              <?php
                $featured = get_field( 'featured_post', $id );

                if( $featured == 'latest' ) :
                  $_post = new WP_Query(array(
                    'posts_per_page' => 1,
                    'orderby'        => 'publish_date',
                    'order'          => 'DESC'
                  ));

                  if( $_post->have_posts() ) :
                    while( $_post->have_posts() ) :
                      $_post->the_post();
                      $first = $_post->posts[0]->ID;
                        require_once( get_template_directory() . '/partials/post-short.php' );
                      endwhile;
                    endif;

                elseif( $featured == 'choose' ) :
                  $_post = get_field( 'choose_featured_post', $id );

                  if( $_post ) :
                    $post = $_post;
                    $first = $post->ID;
                    setup_postdata( $post );
                      require_once( get_template_directory() . '/partials/post-short.php' );
                    wp_reset_postdata();
                  endif;

                endif;
               ?>

            </div>

            <?php
              $_posts = new WP_Query(array(
                'posts_per_page' => 7,
                'orderby'        => 'publish_date',
                'order'          => 'DESC',
                'post__not_in'   => array( $first )
              ));

              if( $_posts->have_posts() ) :
                while ( $_posts->have_posts() ) :
                  $_posts->the_post();?>
                  <div class="col-sm-6 col-md-4 faded">
                    <?php include( get_template_directory() . '/partials/post-short.php' ); ?>
                  </div>
                  <?php
                endwhile;
                wp_reset_postdata();
              endif;
              ?>

          </div>
        </div>

        <?php $index = 1; ?>
      </div>
    </div>
  </div>
</div>

    </div>

<?php
  if ( !is_ajax() ) : ?>
  <div class="content-wrapper-second">
  </div>
  <?php get_footer();
  endif;
?>
</div>