function render($instance)
    {
        // Get Widget Settings
        $defaults = $this->default_settings();
        extract(wp_parse_args($instance, $defaults));
        // Get latest posts from database
        $query_arguments = array('posts_per_page' => (int) $number, 'ignore_sticky_posts' => true, 'cat' => (int) $category);
        $posts_query = new WP_Query($query_arguments);
        $i = 0;
        // Check if there are posts
        if ($posts_query->have_posts()) {
            // Display Posts
            while ($posts_query->have_posts()) {
                $posts_query->the_post();
                ?>

				<article id="post-<?php 
                the_ID();
                ?>
" <?php 
                post_class('single-post');
                ?>
>

					<a href="<?php 
                the_permalink();
                ?>
" rel="bookmark"><?php 
                the_post_thumbnail('category_posts_single');
                ?>
</a>
					
					<h3 class="post-title"><a href="<?php 
                the_permalink();
                ?>
" rel="bookmark"><?php 
                the_title();
                ?>
</a></h3>

					<div class="postmeta"><?php 
                smartline_display_postmeta();
                ?>
</div>

					<div class="entry">
						<?php 
                the_excerpt();
                ?>
						<a href="<?php 
                esc_url(the_permalink());
                ?>
" class="more-link"><?php 
                _e('&raquo; Read more', 'smartline-lite');
                ?>
</a>
					</div>

				</article>

			<?php 
            }
        }
        // Reset Postdata
        wp_reset_postdata();
    }
Beispiel #2
0
?>
" <?php 
post_class();
?>
>
		
		<h2 class="post-title entry-title"><a href="<?php 
esc_url(the_permalink());
?>
" rel="bookmark"><?php 
the_title();
?>
</a></h2>
		
		<div class="postmeta"><?php 
smartline_display_postmeta();
?>
</div>

		<div class="entry clearfix">
			<?php 
smartline_display_thumbnail_index();
?>
			<?php 
the_excerpt();
?>
			<a href="<?php 
esc_url(the_permalink());
?>
" class="more-link"><?php 
_e('&raquo; Read more', 'smartline-lite');
Beispiel #3
0
		
	<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
		
		<h2 class="post-title"><a href="<?php esc_url(the_permalink()) ?>" rel="bookmark"><?php the_title(); ?></a></h2>
		
		<div class="postmeta"><?php smartline_display_postmeta(); ?></div>
	
		<div class="entry clearfix">
			<?php smartline_display_thumbnail_index(); ?>
			<?php the_content( esc_html__( '&raquo; Read more', 'smartline-lite' )); ?>
			<div class="page-links"><?php wp_link_pages(); ?></div>
		</div>
		
		<div class="postinfo clearfix"><?php smartline_display_postinfo(); ?></div>

	</article>