Connect with us

Plugins

How to: Creating an Archive page

Many weblog sites these days have some form of an archive page. In WordPress it might be the built in auto generation of permalinks by: /Month/ and /date/.

But in some blog’s, for instance this one here (as I said in a previous post) you can’t get the post to paginate or link to http://youblog.com/page/2 if you have nice permalinks active or http://youblog.com/?paged=2.

By any means, In this theme I have to have an archive link at the bottom. So..

Archive WordPress Plugins

There are many plugins which allows you to automatically create an archive page. The good thing is that you’ll (almost) have nothing to do, and the bad thing is that you may not be able to customize your archives much.

On this blog I have decided to use Clean Archives Reloaded by Viper007Bond. Which you can now see active in my Archive’s page.

If you want to use a plugin, here is a small list:

And of coarse you can always..

..do it your self!

First you would have to create a template file by writing this:

<?php
/*
Template Name: Archive page
*/

//please add you necessary code here
//ie. your hooks and html code ?>

<ol id="archive">
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts(array(
    'showposts' => 100,
    'offset' => 10,
    'order' =>'DES',
    'paged' => $paged,
    ));
    $wp_query->is_archive = true; $wp_query->is_home = false;

    if( have_posts() ) : while( have_posts() ) : the_post(); ?>

    <li><a href="<?php the_permalink() ?>"><?php $tit = the_title('','',FALSE); echo substr($tit, 0, 25); ?>...</a> - Posted on <?php the_time('j F Y') ?> - Comments (<?php echo $post->comment_count ?>)</li>

<?php endwhile; endif; ?>
</ol>

?>

You may notice this code: <?php $tit = the_title('','',FALSE); echo substr($tit, 0, 25); ?> from a previous post!

Once saved and pasted it to your archives.php or template-archives.php file, upload it on your wp-content/themes/yourtheme/ directory.

Then, in WordPress dashboard, create a new page, name it “Archives” (or whatever you want) and select Archive page as your page template.

enjoy!

1 Comment

1 Comment

You must be logged in to post a comment Login

Random Search Terms

Title

Top Articles

powered by WassUp

Recent Posts: Fully Net Worth . com

Kairi Cosentino Height, Age, Wiki, Bio, Net Worth & More

Kairi Cosentino Height, Age, Wiki, Bio, Net Worth & More

Kairi Cosentino is a social media personality who is best known for uploading different TikTok videos alongside his friends. His videos have a mix of dance, comedy, lip-sync and other types of videos. Cosentino was born on February 8, 2003, in New Jersey, United States which makes him 16 years old now. He is a […]

Alvaro Romero Net Worth: How Rich is the Tik Tok Star Actually?

Alvaro Romero Net Worth: How Rich is the Tik Tok Star Actually?

Alvaro Romero is an American social media star who is best known for his fun videos that include lip-syncs and dance videos on the popular and trendy app among youths right now called TikTok. As of right now, Romero has been able to develop a following of over a million in his TikTok profile with […]

Chrissy Lampkin Net Worth: How Rich is the Television Star?

Chrissy Lampkin Net Worth: How Rich is the Television Star?

Chrissy Lampkin is an American reality television personality and the Executive Producer at WeTV. She is best known for being a part of the VH1 reality series Love & Hip Hop: New York, as well as the spin-off reality, show Chrissy & Mr. Jones that was conceived after her popularity in the earlier show. As […]