Hi its been 5 long days that i m been not online for most of the time the problem was the electrical cutout at our building so after that incident i m bringing you again a Thesis Customization work. today we will learn to create and cutomize archive page templates in thesis as we know
An archive is a collection of historical records, as well as the place they are located.Archives contain primary source documents that have accumulated over the course of an individual or organization’s lifetime.
I have already told about How to create Archives page in WordPress
.Now today it will creating Archives Template in thesis.
The default thesis Archives template shows archive list by Month and then category for example you can go to Best 2 Know’s Archive Page here.but now we are gonna customize it too what we want like for showing latest 30 posts and Categories.
So for that just copy and paste the below code to custom_functions.php :
function my_archives_template() { ?> <h3 class="top"><?php _e('Latest 30 Posts', 'thesis'); ?></h3> <ul> <?php query_posts('showposts=30'); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php $wp_query->is_home = false; ?> <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a> - <?php the_time(); ?> - <?php echo $post->comment_count ?> <?php _e('comments', 'woothemes') ?></li> <?php endwhile; endif; ?> </ul> <h3><?php _e('By Category:', 'thesis'); ?></h3> <ul> <?php wp_list_categories('title_li=0&show_count=1'); ?> </ul> <?php } remove_action('thesis_hook_archives_template', 'thesis_archives_template'); add_action('thesis_hook_archives_template', 'my_archives_template'); |
This will change your Archives page template , to one that will show your latest 30 Posts and after that the categories.
Hope you like it, I would love to have your feedback.