Jump to content
Sign in to follow this  
barroncuadro

Creating an Archives page?

Recommended Posts

barroncuadro

Hi guys, I'm wondering if I'm missing something; is there an easy way to create an archives page? If not, do I have to use a hook and if so, which one am I using? Typically there would be a template page to choose from in the dropdown when in the archives page, right? Thanks.

Share this post


Link to post
Share on other sites
catrina

By default, there is no archives page displaying a list of all posts created, but there are archives pages for individual months. If you want an archives page, some customization might do the job.


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
barroncuadro

Sorry, so what's the best way to go about this without hacking away? Is this something achievable within template setup? I can do this quickly when I'm building my own themes but can't figure out the "right" way to do it within this theme's structure. I just want a simple, basic, archives page similar to the WP example here: http://codex.wordpress.org/Creating_an_Archive_Index

Share this post


Link to post
Share on other sites
Kate

Hi Barron - This has been something the developers have been working on improving. I'm guessing you're running PlatformPro, is that correct? If so, are you running the latest version? There's been an improvement for the custom template creation (you can read about it here: http://www.pagelines.com/posts/typography-like-youve-never-seen/). If you still have questions after checking that out, please let us know.

Share this post


Link to post
Share on other sites
barroncuadro

Hi Kate, Thanks for your reply. I'm using the newest version of PlatformPro, and though I see all the new additions (quite awesome) I still don't see a clear cut way to create a basic archives similar to the url i referred to earlier: http://codex.wordpress.org/Creating_an_Archive_Index Is there a step by step "right" way to create an archives page without hacking it up? Thanks

Share this post


Link to post
Share on other sites
cmunns

Just use a hook and take the middle portion of that archive code: ` add_action('pagelines_loop_post_start','archives'); function archives(){ <?php if(is_archive():?> <?php the_post(); ?>

<?php the_title(); ?>

<?php get_search_form(); ?>

Archives by Month:

  • <?php wp_get_archives('type=monthly'); ?>

Archives by Subject:

  • <?php wp_list_categories(); ?>
<?php endif;?> `

Share this post


Link to post
Share on other sites
barroncuadro

also, how is this determining that it will only be used on the archives page? can i use is_page? This isn't working but here's the code currently live:

if (is_page( 'Archives' )); {
	
	          add_action('pagelines_loop_post_start','archives_page_template');
	          function archives_page_template(){ ?>
	
	               <?php the_post(); ?>
	               <h1 class="entry-title"><?php the_title(); ?></h1>
	
	               <h2>Archives by Month:</h2>
	
	
  • <?php wp_get_archives('type=monthly'); ?>
<h2>Archives by Subject:</h2>
  • <?php wp_list_categories(); ?>
<?php } }[/code]

good - http://bit.ly/h8sAC9 bad - http://bit.ly/eYv9XA

Share this post


Link to post
Share on other sites
barroncuadro

I've found this old topic on duplicating page templates: http://www.pagelines.com/forum/topic.php?id=4901 I mimicked all the steps, including calling the new page template in platformbase's functions.php file. I also want it to show the archive information only in the archives page. This is outputting on all posts, so I'm assuming it's either my if statement of the wrong hook. Suggestions?

	pagelines_add_page('archives', 'Archives Page');
	
		if (is_page( 'Archives' )); {
		add_action('pagelines_loop_post_start','archives_page_template');
		function archives_page_template(){ ?>
	
			<h1 class="entry-title"><?php the_title(); ?></h1>
	
			<h2>Archives by Month:</h2>
	
	
  • <?php wp_get_archives('type=monthly'); ?>
<h2>Archives by Subject:</h2>
  • <?php wp_list_categories(); ?>
<?php } }[/code]

Share this post


Link to post
Share on other sites
barroncuadro

does anyone have input on this markup and process in the last post?

Share this post


Link to post
Share on other sites
trehopkins

I'm trying to do the same but am a newbie and don't even know where you are putting this code. Is it in the new php template file you created? Have you gotten it to work?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×