Archives Page-How can I add the date before the post title when using "postbypost"?
I'm setting up my Archives page now and, for the time being, I plan on just using: "Show Archives by Date?" = Yes, and "Archives by Date: Type" = postbypost. (I won't have hundreds of posts for the foreseeable future so, at the moment, this approach makes sense. )
But, I would like to change the following on the Archives page: 1. add the Post Date after the the bullet and before the Post Title ... without having to "go outside" to a plugin. 2. get rid of the Byline on the Archives page ... only ... it doesn't make sense to me to have it here. Thanks in advance. P.S. I've attached a screen shot if that will help. |
Okay, I think I'm beginning to get the hang of this theme :) ... I've solved one issue, the one of getting rid of the Byline on the Archive (and Sitemap) page.
I did some more research on WordPress for conditional tags and here too -- where I ran across this code example: http://forum.bytesforall.com/showpos...9&postcount=12 Using that logic, I made the following mod in my ..\themes\atahualpa333\index.php: Code:
<?php if ( !is_page('Archives') && !is_page('Sitemap') ) { ?> // modified 6/10/09 to drop byline from archives and sitemap pages Note: I used the literal page titles because I suspect that when I move my dev site over onto my host's server the Page ID's could very well change. However, I've had no luck so far on resolving my other "issue" on the Archive page: adding a date before the title when using "postbypost". I'm open to suggestions and hints for that one. Thanks in advance. |
Minor oops in my code. I added the remark incorrectly -- it showed up on the Home page. :o
This works: Code:
<?php if ( !is_page('Archives') && !is_page('Sitemap') ) { // modified 6/10/09 by DPH to drop byline from archives and sitemap pages ?> |
As an update, the logic for the look of the archives page content is definitely coming from wp_get_archives( ). So there doesn't seem to be a "simple" mod that I can make via Atahualpa. That makes sense now.
However. Has anyone figured out how to "tweak" wp_get_archives( ) so, when using "postbypost" I can get a list that looks something like this?
Thanks in advance. |
Quote:
|
wp_get_archives has "before" and "after" parameters but those are meant to be used for HTML. To include the post date try a plugin such as http://www.ardamis.com/2007/06/25/ad..._get_archives/
|
I downloaded and activated the plugin, but the instructions said
Edit your theme, replacing wp_get_archives('type=postbypost') with ard_get_archives(); Now, where is that? Supposedly in wp-includes/general-template.php....but I cannot find anything that looks like that in MY general-template.php...or am I wrong? |
Try replacing
PHP Code:
with PHP Code:
|
Thanks for the tip on the plugin: http://www.ardamis.com/2007/06/25/ad..._get_archives/ and modifying ATO --> BELOW the LOOP.
However. I haven't upgraded to WP 2.8.x or Atahualpa 3.4.x yet so I couldn't do the minor surgery as suggested. But. I did take the idea from the plugin's code (shown at the above link) and made that work for me on Atahualpa 3.3.3 by directly modifying ..\wp-includes\general-template.php. [I know it isn't a good idea to modify core code but I haven't had time to do the upgrades so this will work until I do.] Here's the origina "postbypost" code (the three dots indicate omitted code): Code:
} elseif ( ( 'postbypost' == $type ) || ('alpha' == $type) ) { Code:
} elseif ( ( 'postbypost' == $type ) || ('alpha' == $type) ) { Note: for brevity's sake, the closing brackets have been omitted from the above sample, so if you wish to make a similar tweak don't copy this code verbatim; instead, backup general-template.php and then add the three lines of code in red placing them where shown. You can see an example of this in use at my site: www.fromtheranks.com. Click on the "Archives" tab on the Page Bar. Hope this helps. |
All times are GMT -6. The time now is 07:16 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.