wantmoore
Member
Posted 9 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.
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.
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
Karl
Karl,
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!
Karl
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.
mrlarter
Member
Posted 9 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?
The Rewrite lines go in your .htaccess file.
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!!
@mamabean,
Did you modify the mod_rewrite rules? Looks like they are still pointing to index.php.
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!!
Working great except....try going to one of your single post archives.
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.
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?
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?
Nick: on it's way (through your form on your site.)
Cena,
I haven't received the email yet, so I may be having some problems with that form. :-/
Well, if you want to email me at cena AT cox-internet DOT com, I'll reply with the file . :)
Oop..plurk, would you mind posting your code in the wiki?
I hadn't posted the actual code...but a link to the code on my site.
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.
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.