• Hey guys. I’ve been looking through forums and the documentation and have been unable to find the right solution to my problem. Maybe I’m not using the right search terms or not applying the right method but I’ve decided to ask directly.

    What I’m looking to do:
    Create a Page called “Blog” that will use a Template called “Blog.php(or similar).
    Have Blog Page pull the most recent 5 posts, (title, author, date, excerpt) into the center of the body. Meanwhile, create 2 archive lists, one for categories and one by month. Selecting any category or month should take you to a page that pulls all posts that are marked as that category or that month.
    At the bottom of the Page should be pagination (we’d settle with Older/Newer posts but desire a full numerated pagination)

    Where I’m at.
    I’ve been working with someone else on this and our best solution so far gives us the following;
    Separate Blog Page under “../category/blogs/” that gives us all posts.
    Sidebar archive portion that gives us categories and months. Clicking Categories gives us a page with only matching posts, but clicking months do not.
    Pagination does not work. But we get to see a ‘(Page 1 of 1)’ at the bottom.

    The Code we’re working with.

    <?php 
    
    	if (have_posts()) :
    	while (have_posts()) :
    	the_post();
    	?>
    		<div class="blogpost col-md-12">
    					<!-- Call Featured Image for Desktop -->
    			<div class="thumb hidden-xs hidden-sm col-md-2 col-lg-2">
    				<?php the_post_thumbnail();
    				edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' );
    				?>
    			</div>
    					<!-- Call Featured Image for Mobile/Tablet -->
    			<div class="thumb_small hidden-lg col-xs-12 col-sm-12 hidden-md">
    				<?php the_post_thumbnail();
    				edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' );
    				?>
    			</div>
    					<!-- Call Title as Link, Author & Date of Post, and Post Excerpt-->
    			<div class="catblog col-md-10">
    				<h2>
    				<a href="<?php the_permalink() ?>">
    				<?php the_title(); ?></a>
    				</h2>
    
    				<div class="blogauthor col-md-12"><i>by: <?php the_author_meta( 'first_name'); ?>
    				&nbsp &nbsp<?php the_date(); ?></i>
    				</div>
    
    				<?php the_excerpt('&rarr;'); ?>
    			</div>
    
    		</div>
    
    	<?php
    	endwhile;
    
    	endif; 
    
    	?>
    </div>
    
    <!-- End Blog Portion -->
    
    <!-- Sidebar Portion -->
    
    <div class="all_categories col-md-2 col-sm-12">
    	<div class="title col-md-12">
    	<b>Category</b>
    	</div>
    
    	<div class="categories col-md-12">
    	<b><?php wp_list_categories('orderby=name&show_count=1&child_of=21&title_li='); ?></b>
    	</div>
    
    	<div class="title col-md-12">
    	<b>Archives</b>
    	</div>
    
    	<div class="categories col-md-12">
    	<b><?php wp_get_archives( $args ); ?></b>
    	</div>
    </div>
    
    <!-- End Sidebar Portion -->
    
    </div>
    <div class="navigation">
    
    <?php wpex_pagination(); ?>
    
    <?php echo '(Page '.$page.' of '.$numpages.')'; ?>
    	<span class="newer">
    	<?php previous_posts_link(__('? Newer','example')) ?></span>
    	<span class="older">
    	<?php next_posts_link(__('Older ?','example')) ?></span>
    </div><!-- /.navigation -->

    At the moment we’re pretty sure we’ve done it wrong but this has brought us the closest to our intended solution.

    I’m hoping someone either knows the exact terms we need to search for in order to fix this or has a solution they see that we haven’t.

    Thank you all for your time!

  • The topic ‘Custom Blog Page Template – Help Requested’ is closed to new replies.