How To Create Missing Files For Your Wordpress Theme
This will not make sense if you have no understanding at all of php and html. I will cover these topics at a later date, but in the meantime google it until I find some resources to put here and if you find something interesting let me know and I will add it here.
NOTE: The examples that I have given may not work with your theme if you copy them as is as your chosen theme may call things differently with regards to the style.css.
comments.php - COMING SOON
comments-popup.php - COMING SOON
single.php - make a copy of the index.php, save it as single.php and ensure that you have the the_content tag and not the the_excerpt tag
page.php - COMING SOON
category.php - make a copy of the index.php, save it as category.php and ensure that you have the the_excerpt tag and not the the_content tag
author.php - COMING SOON
archive.php - make a copy of the index.php, save it as archive.php and ensure that you have the the_excerpt tag and not the the_content tag
searchform.php - copy the code below between the <form></form> into a notepad file and save as searchform.php
<form method=”get” id=”searchform” action=”<?php bloginfo(’url’); ?>/”>
<div><input type=”text” value=”<?php the_search_query(); ?>” name=”s” id=”s” />
<input type=”submit” id=”searchsubmit” value=”Search” />
</div>
</form>
search.php - make a copy of the index.php, save it as search.php and ensure that you have the the_excerpt tag and not the the_content tag, it can also be modified and monetised to suit your blog
an example of a search.php …
<?php get_header(); ?>
<div id=”content”>
<?php if (have_posts()) : ?>
<h2 class=”pagetitle”>Search Results</h2>
<div class=”navigation”>
<div class=”alignleft”><?php next_posts_link(’« Previous Entries’) ?></div>
<div class=”alignright”><?php previous_posts_link(’Next Entries »’) ?></div>
</div>
<?php while (have_posts()) : the_post(); ?>
<div class=”post”>
<h3 id=”post-<?php the_ID(); ?>”><a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?></a></h3>
<small><?php the_time(’l, F jS, Y’) ?></small>
<p class=”postmetadata”>Posted in <?php the_category(’, ‘) ?> | <?php edit_post_link(’Edit’, ”, ‘ | ‘); ?> <?php comments_popup_link(’No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?></p>
</div>
<?php endwhile; ?>
<div class=”navigation”>
<div class=”alignleft”><?php next_posts_link(’« Previous Entries’) ?></div>
<div class=”alignright”><?php previous_posts_link(’Next Entries »’) ?></div>
</div>
<?php else : ?>
<h2 class=”center”>No posts found. Try a different search?</h2>
<?php include (TEMPLATEPATH . ‘/searchform.php’); ?>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
404.php - make a copy of the index.php, save it as 404.php, take out all text relating to posts and comments and modify it to suit your blog
an example of a 404.php …
<?php get_header(); ?>
<h2 class=”center”>Not Found</h2>
<p class=”center”>Sorry, but you are looking for something that isn’t here.</p>
<?php include (TEMPLATEPATH . “/searchform.php”); ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>


Newsvine
Email This to a Friend
RSS - Subscribe To This Post