WordPress.org

Ready to get started?Download WordPress

Forums

Creating an archive page (11 posts)

  1. elementalgrace
    Member
    Posted 4 years ago #

    Hi there,

    I hope this doesn't make me look completely stupid, but I was wondering if you could offer a WordPress newbie a bit of a hand with something.

    I've installed the software onto my webspace (version 2.9.2) and installed the Swift theme, using the magazine configuration. I have created the main pages and am beginning to write the posts but I want a link in my top navigation that essentially links to an archive of the blog posts. I looked up the tutorial on how to do that, and it says add new page (check) and go to page templates in the sidebar... and that's where I get confused because as far as I can see, there ISN'T an option called Page Templates in the sidebar or anywhere else I can see. Am I being epically stupid? If I'm not (and it's a small chance, I know) - what is the best way to do this...

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    In the Admin/Pages/Edit Page section, look for the Page Template dropdown about halfway down the right sidebar.

  3. elementalgrace
    Member
    Posted 4 years ago #

    The right sidebar has sections called Publish & Attributes and I cannot see anything called Page Template. Am I being completely blind or somehow misunderstanding what right sidebar means or ....?

    Seriously I feel incredibly thick here.

  4. elementalgrace
    Member
    Posted 4 years ago #

    OK, if I click quick edit instead of full edit, there's a dropdown called template, but the only available option is default :0/ Any ideas?

  5. esmi
    Forum Moderator
    Posted 4 years ago #

    Looks like your theme doesn't include any custom page template files by default. You would need to create your own custom page templates.

    See the archives.php template in the default theme for an example of how to create an archive list page.

  6. elementalgrace
    Member
    Posted 4 years ago #

    But archive.php is in the theme folder? I opened it up and it says this:

    <?php 
    
    global $opt;
    
    global $design_opt;
    
    get_header();
    
    ?>
    
    <div id="content" class="grid_10">
    
    <?php 
    
    	if($design_opt['swift_archives_magzine']=="magzine")
    
    		magloop(0);
    
    	else
    
    		blogloop($opt['swift_archive_excerpts_enable'],$opt['swift_thumbs_disable'],0);
    
    ?>
    
    </div><!--/content-->
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>
  7. esmi
    Forum Moderator
    Posted 4 years ago #

    archives.php

    Note the 's' at the end.

  8. elementalgrace
    Member
    Posted 4 years ago #

    Just before I go on, I wanted to say thanks for the help and your patience!

    So, I wanted to check to make sure I was doing it right, so I switched the theme back to defult, as sure as God made apples, the archives template is in the dropdown just like you described. I switched back to Swift and Nada.

    So I copied archives.php from the default folder and checked to make sure none of the info was theme specific and uploaded it to the swift themes folder. The code reads:

    <?php
    /**
     * @package WordPress
     * @subpackage Swift
     */
    /*
    Template Name: Archives
    */
    ?>
    
    <?php get_header(); ?>
    
    <div>
    
    <?php get_search_form(); ?>
    
    <h2>Archives by Month:</h2>
    	<ul>
    		<?php wp_get_archives('type=monthly'); ?>
    	</ul>
    
    <h2>Archives by Subject:</h2>
    	<ul>
    		 <?php wp_list_categories(); ?>
    	</ul>
    
    </div>
    
    <?php get_footer(); ?>

    Surely THAT ought to be showing up?

  9. esmi
    Forum Moderator
    Posted 4 years ago #

    In theory, it should showing in the dropdown but then I'm not at all familiar with the Swift theme. There may be issues in the theme itself that are stopping the dropdown from being displayed. Have you checked on the theme author's site?

  10. mrengy
    Member
    Posted 4 years ago #

    I'm having the same issue creating a theme from scratch.

    The header for my template file (called blog-archive.php) reads:

    <?php
    /**
     * @package WordPress
     * @subpackage bxd_Theme
     */
    /*
    Template Name: Blog-Archive
    */
    
    get_header();
    ?>

    But still the only option for template is "Default Template".

    I'm on WP 2.9.2 as well.

  11. mrengy
    Member
    Posted 4 years ago #

    I found a solution for the first problem (getting the templates to show up in the template select list in the "quick edit" menu) in another thread.

    Oddly enough, switching to the default theme and back to the theme you are working on made the new templates show up in the list under "quick edit". Why_is_there_no_Page_Template_option_when_writing_or_editing_a_Page

    However, the page I applied the custom template to (a page titled "blog" which is set to display my most recent posts) is not using the custom template. I put in some static code to see if it came through on the page, but it does not.

    (I'd provide a link if I could, but I'm developing the theme locally before I launch it.)

Topic Closed

This topic has been closed to new replies.

About this Topic