コード例 #1
0
	        <?php 
    numbered_in_page_links(array('before' => '<div class="page-links">' . __('', 'framework'), 'after' => '</div>'));
    ?>

	    </div>
        

	  <?php 
    if ($ht_post_title == false) {
        ?>

      <div class="entry-meta">

          <?php 
        ht_entry_date();
        ?>

          <?php 
        if (function_exists('the_views')) {
            the_views();
        }
        ?>

      </div>
      
      <?php 
    }
    ?>

	    <?php 
コード例 #2
0
    /**
    * Outputs the content of the widget.
    *
    * @param array args The array of form elements
    * @param array instance The current instance of the widget
    */
    public function widget($args, $instance)
    {
        extract($args, EXTR_SKIP);
        $title = $instance['title'];
        $valid_sort_orders = array('date', 'title', 'comment_count', 'random');
        if (in_array($instance['sort_by'], $valid_sort_orders)) {
            $sort_by = $instance['sort_by'];
            $sort_order = (bool) $instance['asc_sort_order'] ? 'ASC' : 'DESC';
        } else {
            // by default, display latest first
            $sort_by = 'date';
            $sort_order = 'DESC';
        }
        // query array
        $args = array('orderby' => $sort_by, 'order' => $sort_order, 'posts_per_page' => $instance["num"], 'ignore_sticky_posts' => 1);
        echo $before_widget;
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        $wp_query = new WP_Query($args);
        if ($wp_query->have_posts()) {
            ?>


<ul class="clearfix">

<?php 
            while ($wp_query->have_posts()) {
                $wp_query->the_post();
                ?>


  <li class="clearfix <?php 
                if ($instance["thumb"]) {
                    ?>
has-thumb<?php 
                }
                ?>
"> 

<?php 
                if (function_exists('has_post_thumbnail') && $instance["thumb"]) {
                    ?>

<?php 
                    if (has_post_thumbnail()) {
                        ?>

	<div class="widget-entry-thumb">
		<a href="<?php 
                        the_permalink();
                        ?>
" rel="nofollow">
		<?php 
                        the_post_thumbnail();
                        ?>

		</a>
	</div>
<?php 
                    } else {
                        ?>

	<div class="widget-entry-thumb no-thumb <?php 
                        echo get_post_format();
                        ?>
">
		<a href="<?php 
                        the_permalink();
                        ?>
" rel="nofollow"><i class="icon-file-text-alt"></i></a>
	</div>
<?php 
                    }
                    // Has thumb
                    ?>

<?php 
                }
                //Show thumbnail
                ?>


<a class="widget-entry-title" href="<?php 
                the_permalink();
                ?>
" rel="bookmark" title="<?php 
                the_title_attribute();
                ?>
"><?php 
                the_title();
                ?>
</a>

<?php 
                if ($instance['date'] || $instance['comment_num']) {
                    ?>

    <ul class="widget-entry-meta">
    <?php 
                    if ($instance['date']) {
                        ?>

    <li class="entry-date"><i class="icon-time"></i><time datetime="<?php 
                        echo get_the_date('c');
                        ?>
"><?php 
                        echo ht_entry_date();
                        ?>
</time></li>
    <?php 
                    }
                    ?>

    <?php 
                    if ($instance['comment_num']) {
                        ?>

    <?php 
                        $number = get_comments_number(get_the_ID());
                        if ($number != 0) {
                            ?>

    <li class="entry-time"><i class="icon-comments"></i><?php 
                            comments_number();
                            ?>
</li>
    <?php 
                        }
                        ?>

    <?php 
                    }
                    ?>

    </ul>
    <?php 
                }
                ?>

  </li>
 <?php 
            }
            ?>

</ul>

<?php 
        }
        wp_reset_query();
        echo $after_widget;
    }