Connect with us

Plugins

How to: Creating an Archive page

Published

on

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!

Continue Reading
1 Comment

1 Comment

  1. arcade games

    March 11, 2009 at 3:07 pm

    thanks for this information.

    I think there is a plugin for this job

You must be logged in to post a comment Login

Leave a Reply

News

Possible photo tagging plugin update

Have you tried to download any of the community tagging plugins with no prevail?

Published

on

I recently posted a comment in response to a post on Justin Tadlock’s WordPress site about custom taxonomies. Then was asked by a reader how I integrated my custom taxonomies with one of Matt Mullenwegs “tagging” plugin.

  1. Community Tags
  2. Matt’s Community Tags

Anyway, I tried to install and use both plugins before with no luck. But decided to download Community Tags and try my luck again. With some hacking, I got it working. For a demo you can check out and tag (someone you know or recognize only, please) a picture over at my photography site, http://thefrosty.com.

Anyway, before I get carried away, I had a reader email me and ask how I integrated the plugin. And I thought I would ask you if you would be interedted in a re-re-release of the plugin.

At present time I do have some array errors, but everything works just fine as is.

Your comment feedback would be great! Thanks!

Continue Reading

Plugins

Follow up on WordPress plugin changelogs

Following up on the WordPress weekly, and the final topic of discussion; changelogs and implementing them into your plugins. Now a plugin, shows the changelog in your plugin page…

Published

on

Changelogger, a plugin which will show the changelog of that plugin directly on your plugin page, as long as it exists within the plugin readme.txt file. Download it from the WordPress plugin repository.

Remember, if your a plugin developer, please read and use this template for your readme file.

Continue Reading

Cult

Initial dot org release of VideoPress

Published

on

Version 0.1.0 of VideoPress now available for you self hosted WordPress blog.

Continue Reading

Trending