Esempio n. 1
0
		<?php 
if (ar2_get_theme_option('post_display[excerpt]') && has_excerpt()) {
    ?>
			<div class="entry-excerpt"><?php 
    the_excerpt();
    ?>
</div>
		<?php 
}
?>
		
		<?php 
if (ar2_get_theme_option('post_display[single_thumbs]') && has_post_thumbnail($post->ID)) {
    ?>
			<div class="entry-photo"><?php 
    echo ar2_get_thumbnail('single-thumb');
    ?>
</div>
		<?php 
}
?>
		
		<?php 
if (ar2_get_theme_option('post_display[post_social]')) {
    ?>
		<div class="entry-social">
				<div class="addthis_toolbox addthis_default_style" 
					addthis:url="<?php 
    echo esc_attr(get_permalink($post->ID));
    ?>
"
/**
 * The template for displaying content in 'Node Based' post section.
 * @since 1.6
 */
?>
<div <?php 
post_class();
?>
>
	<div class="entry-thumbnail clearfix">
		<a rel="bookmark" href="<?php 
the_permalink();
?>
">
			<?php 
echo ar2_get_thumbnail('section-thumb', false, array('class' => 'section-thumb'));
?>
			<span class="entry-comments"><?php 
echo get_comments_number();
?>
</span>
		</a>
	</div>
	
	<h3 class="entry-title"><a href="<?php 
the_permalink();
?>
" rel="bookmark"><?php 
the_title();
?>
</a></h3>
Esempio n. 3
0
/**
 * Shared function to display certain posts in the widget.
 * @since 1.3
 */
function ar2_widgets_post_loop($id, $args = array())
{
    global $wp_query;
    $_defaults = array('taxonomy' => 'category', 'show_thumbs' => true, 'show_excerpt' => true, 'query' => array('post_type' => 'post', 'posts_per_page' => 5, 'orderby' => 'date', 'order' => 'DESC', 'ignore_sticky_posts' => 1));
    $args['query'] = wp_parse_args($args['query'], $_defaults['query']);
    $args = wp_parse_args($args, $_defaults);
    $q = new WP_Query($args['query']);
    if ($q->have_posts()) {
        echo '<ul class="' . $id . '">';
        while ($q->have_posts()) {
            $q->the_post();
            // hack for plugin authors who love to use $post = $wp_query->post
            $wp_query->post = $q->post;
            setup_postdata($q->post);
            ?>
<li <?php 
            post_class();
            ?>
> 
			
			<?php 
            if ($args['show_thumbs']) {
                ?>
			<a class="entry-thumbnail" href="<?php 
                the_permalink();
                ?>
" title="<?php 
                the_title();
                ?>
"><?php 
                echo ar2_get_thumbnail('sidebar-thumb', get_the_ID());
                ?>
</a>
			<?php 
            }
            ?>
			
			<a class="entry-title" rel="bookmark" href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a><br />
			<small><?php 
            printf(__('Posted %s', 'ar2'), ar2_posted_on(false));
            ?>
</small>
			
			<?php 
            if ($args['show_excerpt']) {
                ?>
			<p class="entry-content">
			<?php 
                echo get_the_excerpt();
                ?>
			</p>
			<?php 
            }
            ?>
			
			</li>
			<?php 
        }
        echo '</ul>';
    } else {
        echo '<small>' . __('No posts at the moment. Check back again later!', 'ar2') . '</small>';
    }
    wp_reset_query();
}