Пример #1
0
<?php

use Framework\Helpers\Loop;
use Framework\Helpers\PostHelper;
$loop = new Loop();
$post_helper = new PostHelper();
get_header();
?>
<main class="main-content elr-container-full">
    <div class="elr-row">
        <div class="content-holder elr-col-two-thirds">
            <?php 
$loop->singleLoop();
?>
            <h3>Related Posts</h3>
            <?php 
echo $post_helper->relatedPosts('category');
?>
        </div>
        <aside class="sidebar elr-col-third" id="sidebar"><?php 
get_sidebar();
?>
</aside>
    </div>
</main>
<?php 
get_footer();
Пример #2
0
 /**
  *
  *
  * @since  1.0.0
  * @access public
  * @param
  * @return void
  */
 public function singleLoop($archive_link = false, $archive_link_text = null)
 {
     while (have_posts()) {
         the_post();
         $utility = new Utility();
         $content_helper = new ContentHelper();
         $post_helper = new PostHelper();
         if ($utility->isCustomPostType()) {
             get_template_part('content/content', get_post_type());
         } else {
             get_template_part('content/content', get_post_format());
         }
         $content_helper->linkPages();
         get_template_part('partials/post-nav');
         if ($utility->isCustomPostType() && $archive_link_text) {
             $post_helper->archiveLink(get_post_type(), $archive_link_text);
         }
     }
 }
Пример #3
0
<?php

use Framework\Helpers\PostHelper;
use Framework\Helpers\ContentHelper;
$post_helper = new PostHelper();
$content_helper = new ContentHelper();
?>

<article role="article" id="post-<?php 
the_ID();
?>
" <?php 
post_class('post');
?>
>
    <header>
        <?php 
$post_helper->postTitle();
?>
        <?php 
$post_helper->postMeta(get_the_ID());
?>
    </header>

    <?php 
$post_helper->postThumbnail();
?>
    <?php 
$post_helper->postContent();
?>
    <?php