I think you’re going about this the wrong way. wp_get_archives(); can only output lists of titles and dates and stuff like that — it can’t output excerpts like you want it to without going in and hacking the core code itself. You can probably accomplish what you want easily with a new Page template. Maybe:
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_time('Y.m.d'); ?></a> -- <?php the_title(); ?> -- <?php the_excerpt(); ?>
Thread Starter
pelias
(@pelias)
Avenir — Thank you for your quick reply. I is much appreciated!
Did you want me to add that code to the “page.php” in “/WP/themes/theme/page.php? Or place the code in a new “Page” within WordPress?
I have a few other pages in the system so I am hesitant to edit “page.php”. I did place the code into the new page I created (via WP) and was not able to get any output.
actually, create a separate archive.php and add that code. That way when an archive page is called it will use that template. If you dont want to create a separate file, use an if statement, ie:
<?php /* If broswing a monthly archive page */ if ( is_month() || is_page() ) { ?>
<?php the_excerpt ?> or whatever you want to display
<?php } ?>
you can browse the codex for other ways to implement conditionals.
http://codex.wordpress.org/Conditional_Tags
Thread Starter
pelias
(@pelias)
omanno – thank you for the help.
There has to be something really simple that I am not grasping here because when I edit a copy of the “archive.php” (named archive-news.php) and select it as the template page I can’t get more than the date and page title displayed — not the info from the posts in the system (all newsroom items).
I have a category called “news” setup as well as an archive page called “newsroom”. If I go to “website.com/content/news/” the category listing shows perfectly but only shows one post at a time. No biggie. When I try “website.com/content/newsroom/” (the page setup in WP with the archive-news template page) I am unable to get the info to display.
My “archives-new.php” file contains:
<?php
/*
Template Name: Archives - News
*/
?>
<?php get_header(); ?>
<h1><span class="blue">New Day Trust</span> Newsroom</h1>
<div class="contentListing">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_time('Y.m.d'); ?></a> -- <?php the_title(); ?> -- <?php the_excerpt(); ?>
</div>
<?php get_footer(); ?>
I guess you have to put that stuff in The Loop; see this
Thread Starter
pelias
(@pelias)
moshu — thanks for the tip. However i did that in another version of the template with no luck. doing so just lists the date then nothing else. the_title(); just returns “newsroom” not the title of the post (returns the title of the page).
I am going to try and hack a version of wp_get_archives(); so see if that is the best way to go about this. I can’t seem to get things to loop right. super frustrating I tell ya.