SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Aug 2008
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Moving index.php to archive.php

    I customized my wordpress front page to show some images but no postings.

    instead, i am trying to moved the "show latest post" to another page which will be "news archive".

    I try to do this simply by copying the original index.php code to another template file which is archiving.php

    Using Twenty Ten theme btw.

    I assign a page i created called News Archive with the template archiving.php.

    Problem is, the posts doesn't show up like its suppose to. Where did i go wrong?

    The code from the index.php (copied to archiving.php)

    PHP Code:
    <?php
    /**
     * The main template file.
     *
     * This is the most generic template file in a WordPress theme
     * and one of the two required files for a theme (the other being style.css).
     * It is used to display a page when nothing more specific matches a query. 
     * E.g., it puts together the home page when no home.php file exists.
     * Learn more: http://codex.wordpress.org/Template_Hierarchy
     *
     * @package WordPress
     * @subpackage Twenty_Ten
     * @since Twenty Ten 1.0
     */

    get_header(); ?>

            <div id="container">
                <div id="content" role="main">

                <?php
                
    /* Run the loop to output the posts.
                 * If you want to overload this in a child theme then include a file
                 * called loop-index.php and that will be used instead.
                 */
                 
    get_template_part'loop''index' );
                
    ?>
                </div><!-- #content -->
            </div><!-- #container -->

    <?php get_sidebar(); ?>
    <?php get_footer
    (); ?>

  2. #2
    SitePoint Guru ckita's Avatar
    Join Date
    Nov 2004
    Location
    Truly Asia
    Posts
    733
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Why not use the static page feature?

    Settings>> Reading >> Front Page


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •