예제 #1
0
    public static function content_posts_for_home()
    {
        global $wp_query, $paged, $wdwt_front;
        $hide_content_posts = $wdwt_front->get_param('hide_content_posts');
        $hide_video_post = $wdwt_front->get_param('hide_video_post');
        $date_enable = $wdwt_front->get_param('date_enable');
        $blog_style = $wdwt_front->get_param('blog_style');
        $grab_image = $wdwt_front->get_param('grab_image');
        if (is_home()) {
            ?>
<div id="blog" class="blog" ><?php 
            if (have_posts()) {
                while (have_posts()) {
                    the_post();
                    ?>
    <div class="blog-post home-post">        
      <a class="title_href" href="<?php 
                    echo get_permalink();
                    ?>
">
         <h2><?php 
                    the_title();
                    ?>
</h2>
      </a><?php 
                    if ($date_enable) {
                        ?>
         <div class="home-post-date">
          <?php 
                        echo news_magazine_frontend_functions::posted_on();
                        ?>
         </div>
        <?php 
                    }
                    ?>
         <div class="img_container unfixed clear"> 
         <?php 
                    if (has_post_thumbnail() || news_magazine_frontend_functions::post_image_url() && $blog_style && $grab_image) {
                        echo news_magazine_frontend_functions::auto_thumbnail($grab_image);
                    }
                    ?>
         </div>
         <?php 
                    if ($blog_style) {
                        the_excerpt();
                    } else {
                        the_content(__('More', "news-magazine"));
                    }
                    ?>
<div class="clear"></div>  
      
    </div>
    <?php 
                }
                if ($wp_query->max_num_pages > 2) {
                    ?>
      <div class="page-navigation">
        <?php 
                    posts_nav_link();
                    ?>
      </div>     
    <?php 
                }
            }
            ?>
    <div class="clear"></div><?php 
            $wdwt_front->bottom_advertisment();
            wp_reset_query();
            ?>
      
  </div>
  <?php 
        } else {
            ?>
   <div id="content">
     <?php 
            if (have_posts()) {
                while (have_posts()) {
                    the_post();
                    ?>
      <div class="single-post">
       <h2><?php 
                    the_title();
                    ?>
</h2>
       <div class="entry"><?php 
                    the_content();
                    ?>
</div>
      </div>
    <?php 
                }
                ?>
       <div class="navigation">
        <?php 
                posts_nav_link();
                ?>
       </div>

    <?php 
            }
            ?>
     <div class="clear"></div>
     <?php 
            wp_reset_query();
            if (comments_open()) {
                ?>
          <div class="comments-template">
            <?php 
                echo comments_template();
                ?>
          </div>
      
      <?php 
            }
            ?>
 
   </div>
 
 <?php 
        }
    }