WordPress Templates w/ Post List By Date

wordpress

#1

We’ve looked all over the web, and the Themeforest community to find some WordPress templates with the ability to display a list or grid (style) posts sorted by date, - surprisingly we didn’t find any.

That said, we’re imploring anyone with the knowledge of such templates, to let us know …

Thanks!

Like this:


#2

Do you have any theme i will customize the output result.

Thanks


#3

Hello WebDesignerArt,

There’ are some articles about creating the loop, I was just curious to see if someone had actually done a WordPress theme with the list sorted by date.

Either way, here’s the loop we are using, let us know if the fix is simple, or if you have suggestions, ideas, or tutorials to add the small date snippet to make it work:

*****************************test-loop;php

<?php global $my_blog_layout; ?>
<div class="my-blog <?php if ( $my_blog_layout == 'list_small' ) : ?>my-listsmall-layout<?php else: ?>my-list-layout<?php endif; ?>">
	<?php if ( have_posts() ) : ?><?php while ( have_posts() ) : the_post(); ?>
            <article id="post-<?php the_ID(); ?>" <?php post_class("blog-item"); ?>>
                <?php
                    $image_featured = null;
                    if ( has_post_format( 'gallery' ) )
                    {
                        $images = get_post_meta( get_the_ID(), '_format_gallery_images', true );
                        if ( isset($images[0]) && (int)$images[0] > 0 )
                        {
                            $image_featured = my_resize_image( $images[0], wp_get_attachment_url($images[0]), 670, 440, true, true );
                            $image_featured = $image_featured['url'];
                        }
                    }
                    elseif ( has_post_thumbnail() )
                    {
                        if ( $my_blog_layout == 'list_small' ) {
                            $image_featured = my_resize_image( get_post_thumbnail_id() , wp_get_attachment_url(), 172, 117, true, true );
                            $image_featured = $image_featured['url'];
                        }
                        else {
                            $image_featured = my_resize_image( get_post_thumbnail_id() , wp_get_attachment_url(), 670, 440, true, true );
                            $image_featured = $image_featured['url'];
                        }
                    }
                ?><?php if ( $image_featured ) : ?>
				<div class="left-post">
					<div class="post-format">
						<a href="<?php the_permalink(); ?>">
						<img alt="<?php the_title(); ?>" src="<?php echo esc_url($image_featured); ?>" /></a></div>
					<?php if ( !get_theme_mod('my_post_cat') && $my_blog_layout == 'list' ) : ?>
					<div class="post-category">
						<?php the_category(', '); ?>
					</div>
					<?php endif; ?>
				</div>
				<?php endif; ?>
				<div class="post-info">
					<h3 class="title-post"><?php if ( get_the_title() ) : ?>
					<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
					</a><?php else : ?><a href="<?php the_permalink(); ?>"><?php the_time( get_option('date_format') ); ?>
					</a><?php endif; ?></h3>
					<?php if ( $my_blog_layout == 'list' ) : ?>
					<div class="my-content-post">
						<p><?php echo mytheme_string_limit_words( get_the_excerpt(), 25 );?>
						</p>
					</div>
					<?php if ( !get_theme_mod('my_post_date') ) : ?>
					<div class="post-meta">
						<?php the_time( get_option('date_format') ); ?>
					</div>
					<?php endif; ?><?php endif; ?><?php if ( $my_blog_layout == 'list_small' ) : ?>
					<div class="post-meta-list-small">
						<?php if ( !get_theme_mod('my_post_cat') ) : ?>
						<div class="post-category">
							<?php the_category(', '); ?>
						</div>
						<?php endif; ?><?php if ( !get_theme_mod('my_post_date') || !get_theme_mod('my_post_share_author') ) : ?>
						<div class="post-meta">
							<?php if ( !get_theme_mod('my_post_date') ) : ?><?php esc_html_e( 'Posted on', 'myblog' ); ?>&nbsp;<?php the_time( get_option('date_format') ); ?>
							<?php endif; ?><?php if ( !get_theme_mod('my_post_share_author') ) : ?>
							<?php esc_html_e( 'by', 'myblog' ); ?>&nbsp;<?php the_author_posts_link(); ?>
							<?php endif; ?>
						</div>
						<?php endif; ?>
					</div>
					<?php endif; ?>
				</div>
	</article>
	<?php endwhile; ?>
	<!-- Pagination --><?php mytheme_pagination(); ?>
	<!-- End / Pagination --><?php else: ?><?php get_template_part( 'content-parts/content', 'none' ); ?>
	<?php endif; ?>
</div>