Wooty! That's GREAT! ^_^
Wooty! That's GREAT! ^_^
$what_to_show = 'days' to arch.php does not work because the $what_to_show setting in wp-blog-header.php overrides it. wp-blog-header.php grabs the value for $what_to_show from the settings entered in the other blog options.
I got it to work by making a copy of wp-blog-header.php and renaming it wp-blog-archheader.php. To make wp-blog-archheader.php show days instead of grabbing the value set in the options menu, I changed the line
$what_to_show = get_settings('what_to_show'); to
$what_to_show = 'days' in wp-blog-archheader.php.
To get arch.php to use the new header, change the line
require('wp-blog-archheader.php') in arch.php.
Hi, mtdewvirus, I wanted to say it's a great archive hack. I'm using it right now. The only thing that baffled me is how come whenever I try to click on permalinks on Archives page, I get a blank page? I'm not sure if I missed something here. It just shows http://www.domain.com/archives/2004/03/07/blah/ as 404 Not Found page. How do I get my old entries to show up in archives dir or how does that work? I'm still fairly new to all of this...but trying my best...
Thanks for that. I did find that also, but forgot to add it to this thread (I actually forgot about this thread!). I simply changed it in wp-blog-header.php so that I didn't have to call a seperate file in.
Once a new release of WP is out, I need to update the instructions in the Wiki for this and a few other changes.
Sorry I haven't posted earlier, but I've been in San Diego.
Can you post a link to your site so that I can see what is happening. A good test is usually to call arch.php directly and pass it a date to see if the file is working. Usually there was either an error in creating the file or in setting up the rewrite rules.
Hmm.. I've broken stuff *again*
I've reinstalled the archives hack .. but:
1. Clicking on 'Comments' on the main page generates some sort of arhives link and no comments can be made.
2. Although posts are displayed when clicking a category, or a month, when an individual post is clicked, the post itself does not appear.
It's almost like I've left something off the end of the permalinks thing.
It currently is set as;
Have you modified the rewrite rules at all? I've been using the latest CVS code and the only modifications I've made to my rewrite rules are to add the new rules for all of the feeds. Everything else should still be the same.
I have replaced what I had with what you advised on 30 Jan.
Calling /T2/arch.php I can see files.
I cannot see posts, and I cannot get any commenting.
I've commented inside both index.php and arch.php so I can View Source to check what is being called.
I have made the @import for the css use an absolute path.
I still can't see why it just will not go right .. I think I've banged my head on this one once too many - it'll probably be as clear as day tomorrow. If not, I'll clear everything, and start afresh, making the archive's mod the first thing on my list.
Do you have what_to_show = 'days' in the options?
Right, fixed it .. sort of.
Comments now work, as does clicking on a category link, or a month archive link.
What is odd is that when clicking on a category or a month, the file 'arch.php' is used, yet when an individual post is clicked on - be that from the front page or from an archive - the file 'index.php' is being used.
If in that last rewrite rule above I change the last arch to index, the whole thing breaks.
And I actually wanted arch.php to be used for individual posts, *not* index.php.
Still, at least it all works :)
On http://thetrenchcoat.com/test/arch.php I'm getting each entry and no category archives. How do I make it so there are just the month and the category?
For some reason I can not get this to work in WP 1.2
Has something changed since then?
http://www.site.com/archives/2004/ shows a list of each entry for that particular year. Great!
http://www.site.com/archives/ to show a list of each entry for all years using the format of the first URI.
Currently it just outputs two lists:
"By Category" and "By Date"
From what I know, there isn't a quick and easy way to do this, because when you call /archives/2004/ it is passing the year 2004 to index.php which then calls up all of the posts from that year. If you call /archives/ it passes nothing to index.php, which by default brings up the front page of your blog or in the case of the archives, brings up a page letting you choose which archives you want.
It's kind of the same as if you wanted to display the posts on a page from both May and June of a year, there isn't a way to pass both months, so the same is true for years.
There might be a way to hack it, but I wouldn't know where to start.
Mt Dew Virus, do you have an update for this hack now that 1.2 is out? I can't figure out how to implement it in the new version.
Inspector Chan, which "new version" are you referring to: 1.2.1 or 1.3*? It still works on 1.2.1, but I haven't tested 1.3.
I know this came pretty late but I've spruced up the archives hack and it seemed to work, but for some reason the mod_rewrite (or something else) only shows all of the posts in that date or category at once. It does show category and date on main page but whenever I click on either one, it jumps straight to display all posts. How do I adjust it so it wouldn't do that? Like after clicking on either category or date, it'd show up a list of all posts and then you have an option to click on one of the posts you want to read. I was using the proffered mod_rewrite for the .htaccess file, but if I used your mod_rewrite it wouldn't work because it would go to a list of posts but if I try to click on any one of those, it'd not display the post itself. Is there a fix for this? Thanks for your time and I really like your hack, I wish it'd work properly like yours!
A link to your site would really help to see what is happening. My guess is that you are not pointing the single post pages at index.php, they are going to arch.php or whatever you have the file named.
Folks...there are much easier ways to accomplish this now in the 1.3 beta code so once it finally goes final, I'll come out with an update in the form of a theme.
I see. That's probably it. I was pointing to archives.php, not to an index.php. link
I guess I have to wait for the upgrade to 1.3 to achieve this, so the way it is for now is fine unless there's a quick fix. Thanks again.
Just in case anyone stops by here, For WP 1.5, there is a great new way to do this.
This topic has been closed to new replies.