예제 #1
0
 /**
  *
  *
  * @since  1.0.0
  * @access public
  * @param
  * @return void
  */
 public function postContent($excerpt = true, $num_characters = 100)
 {
     $content = get_the_content();
     $content_helper = new ContentHelper();
     if (is_single()) {
         echo '<div class="post-content">';
         the_content();
         echo '</div>';
     } elseif ($excerpt === true) {
         echo '<div class="post-excerpt">';
         echo $content_helper->trimContent($content, $num_characters);
         echo '</div>';
     } else {
         the_content();
     }
 }
<?php

use Framework\Helpers\ContentHelper;
$content_helper = new ContentHelper();
get_header();
?>
<main class="main-content elr-container-full">
    <div class="elr-row">
        <div class="content-holder elr-col-two-thirds">
        <?php 
while (have_posts()) {
    the_post();
    ?>
            <?php 
    get_template_part('content/content', get_post_type());
    ?>
            <?php 
    $content_helper->linkPages();
    ?>
            <?php 
    get_template_part('partials/post-nav');
    ?>
            <?php 
    //comments_template();
    ?>
        <?php 
}
?>
        </div>
        <aside class="sidebar elr-col-third" id="sidebar">
            <?php 
예제 #3
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);
         }
     }
 }
예제 #4
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