Support » Plugins » New Archive Structure

  • I’ve been working on a new archive structure (similar to these) and would like some feedback and testing help.
    Things to note:
    1) This requires the use of the new permalinks structure and mod_rewrite, if there is a way to do it without these two, don’t ask me. 😉
    2) Single day and single post archives still use index.php.
    3) All other archives (including category archives) use a file I’ve created.
    4 The mod_rewrite rules have been modified to allow for 2 and 3 above.
    5) If a date or category isn’t passed to the archives, a list of categories and archives are displayed.
    6) You can click on months and years in the archives to drill down to another archive.
    7) Clicking on a day number, post title, or comment link will send you to index.php and display the appropriate post(s).
    That’s all I can think of for right now. I need to setup a test blog with the default WP install to test this out and make some modifications to the CSS. Once everything is working well, I’ll release the code.
    All feedback is welcome!

Viewing 15 replies - 1 through 15 (of 67 total)
  • I’m highly interested in this. I was just thinking the other day of asking if there was a way to list each month under the year for archiving, as I feel that repeating the year after each month is starting to look a bit tacky. I look forward to trying this out.

    This is exactly what I have been wanting to do!! I don’t know how much help I would be testing but am definitely very interested!!

    I think it’s ready…
    Get it at my site while it’s HOT!
    Let me know how it works.

    Wiki added…

    Haha, I was just hacking on a function just like the one you wrote. Glad I saw this before I finished! Good work.

    *offers MtDew her firstborn child*

    Oooo, I can’t wait to try! Thanks bunches!!

    Hi there MtDew 🙂
    By the way thanks for your previous help with the archives!
    Do you think you could possibly tell me what parts are actually required in the arch.php so I can just make modifications to my existing index.php file and then rename it arch.php? Is it just the code between the content div?
    The reason I ask is that I did implement this but when I clicked on archives all I got was the Single day and single post archives and not the ‘By Category’ and ‘By Month’ first.
    Any ideas?
    Thanks a lot

    Good point, I’m going to rework my instructions for this exact purpose (using a copy of index.php). Should be ready shortly.

    Try out the new instructions. I wrote it up to use a copy of the index.php instead so that menus, headers, footers, etc. are preserved!

    If anyone has an idea of how to implement this into the actual index.php (so that another file isn’t needed, I’d love to hear/see it!

    Thanks for that!
    Will give it a go after tea!

    There seems to be a problem with using:
    $posts_per_page = ‘-1’;
    It’s not working, depending on how Options->Other Options are set in the admin.
    Does anyone know a way to over-ride the posts?

    If Options->Other Options->what_to_show in the admin is set to “days”, it seems to be working as planned, but if set to “posts” or “posts_paged”, the else portion (that displays the categories and monthly archives) doesn’t work.

    this is my first wp hack so I am unsure what this means exactly
    ** These are MY mod_rewrite functions.
    ** I use /archives/%year%/%monthnum%/%day%/%postname%/
    ** for my permalink structure and I have index.php and
    ** arch.php at the root of my website.
    ** If you use a different permalink structure or your
    ** files are in a different directory, you’ll have
    ** to modify these rules accordingly.
    RewriteEngine On
    RewriteBase /
    RewriteRule ^archives/?([0-9]{4})?/?([0-9]{1,2})?/?$ /arch.php?year=$1&monthnum=$2 [QSA]
    RewriteRule ^archives/category?/?(.*) /arch.php?category_name=$1 [QSA]
    RewriteRule ^archives/([0-9]{4})?/?([0-9]{1,2})?/?([0-9]{1,2})?/?([0-9a-z-]+)?/?([0-9]+)?/?$ /index.php?year=$1&monthnum=$2&day=$3&name=$4&page=$5 [QSA]
    what do i do with that?

Viewing 15 replies - 1 through 15 (of 67 total)
  • The topic ‘New Archive Structure’ is closed to new replies.