WordPress.org

Ready to get started?Download WordPress

Forums

New Archive Structure (67 posts)

  1. wantmoore
    Member
    Posted 10 years ago #

    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.

  2. mamabean
    Member
    Posted 10 years ago #

    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!!

  3. Nick Momrik
    Member
    Posted 10 years ago #

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

  4. Nick Momrik
    Member
    Posted 10 years ago #

    Wiki added...

  5. Matt Mullenweg
    Troublemaker
    Posted 10 years ago #

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

  6. Cena
    Member
    Posted 10 years ago #

    *offers MtDew her firstborn child*

  7. mamabean
    Member
    Posted 10 years ago #

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

  8. KarlB
    Member
    Posted 10 years ago #

    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
    Karl

  9. Nick Momrik
    Member
    Posted 10 years ago #

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

  10. Nick Momrik
    Member
    Posted 10 years ago #

    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!

  11. Nick Momrik
    Member
    Posted 10 years ago #

    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!

  12. KarlB
    Member
    Posted 10 years ago #

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

  13. Nick Momrik
    Member
    Posted 10 years ago #

    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?

  14. Nick Momrik
    Member
    Posted 10 years ago #

    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.

  15. mrlarter
    Member
    Posted 10 years ago #

    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?

  16. mamabean
    Member
    Posted 10 years ago #

    The Rewrite lines go in your .htaccess file.

  17. mamabean
    Member
    Posted 10 years ago #

    hmm... I must have missed something or done something wrong maybe. I get the 'by date' and 'by category' lists on my arch.php page but when I click the links, I get whole posts rather than linked titles.
    Did I miss a step somewhere or did I mess up somewhere? *L*
    Thanks!!

  18. Nick Momrik
    Member
    Posted 10 years ago #

    @mamabean,
    Did you modify the mod_rewrite rules? Looks like they are still pointing to index.php.

  19. mamabean
    Member
    Posted 10 years ago #

    Ooooh!!! I forgot about that! That does make a difference, doesn't it. *L*
    I knew I had to have been missing something. Working great now! Thanks!!

  20. Nick Momrik
    Member
    Posted 10 years ago #

    Working great except....try going to one of your single post archives.

  21. Nick Momrik
    Member
    Posted 10 years ago #

    Try using the mod_rewrite rules I specified in the instructions. It looks as if you've replaced all instances of index.php with arch.php in your rules.

  22. Nick Momrik
    Member
    Posted 10 years ago #

    Cena,
    It appears as if the problem is in arch.php. It looks like the permalinks are getting written correctly since I can get to your single post and single day archives.
    I made some modifications to the instructions this afternoon, are you using those or the ones from this morning?

  23. Nick Momrik
    Member
    Posted 10 years ago #

    Would it be possible for you to post your arch.php file to the Wiki somewhere or send it to me so I can have a look?

  24. Cena
    Member
    Posted 10 years ago #

    Nick: on it's way (through your form on your site.)

  25. Nick Momrik
    Member
    Posted 10 years ago #

    Cena,
    I haven't received the email yet, so I may be having some problems with that form. :-/

  26. Cena
    Member
    Posted 10 years ago #

    Well, if you want to email me at cena AT cox-internet DOT com, I'll reply with the file . :)

  27. Cena
    Member
    Posted 10 years ago #

    Oop..plurk, would you mind posting your code in the wiki?

  28. Nick Momrik
    Member
    Posted 10 years ago #

    I hadn't posted the actual code...but a link to the code on my site.

  29. plurk
    Member
    Posted 10 years ago #

    I noticed that, but you also mentioned something about adding something to the wiki. Not that it overly matters now I think. The mess that I made of the forum has been fixed.

  30. Nick Momrik
    Member
    Posted 10 years ago #

    Well....a link to the code on my site had been added to the Wiki. I just looked and it was gone...maybe I forgot to save it after previewing. It should be there now.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.