Unlimited<br /> Autoresponders by AWeber

Posts Tagged ‘Templates’

Wordpress Theme Files Explained

All themes are not created equal.

Wordpress will work with a theme that has only an index.html and a style.css, but you can get penalised for duplicate content on your own site. Yes, you read it right, you can get penalised for duplication of your own original work. How unfair is that! With a Wordpress theme that has all the necessary files showing the correct information this will not happen.

I think that they should change the rules for themes and ensure that they do have all the required files, but as their own theme viewer has been down for many months it seems that they have more work than they can handle at the moment.

Below is an explanation of all the files that should be included in a wordpress theme …

style.css - this is the stylesheet which tells all the other files in the theme how to behave with regards to colours etc … and must also contain the information about you and your theme in the header

an example of the header is …

/*
Theme Name: XXX - Version 1
Theme URI: http://www.onthenetdollars.com
Description: 2-column widget-ready wordpress blog theme
Author: Kelly Ifrah
Author URI: http://www.onthenetdollars.com
*/

index.php - if this is the only file in the theme then it will contain all the necessary calling of tags (wordpress works on special tags being called from the database), but it should not be and should only hold the main content calling of tags and should also use the the_excerpt tag and not the_content tag to avoid content duplication

(the the_excerpt tag shows just part of the post and the the_content tag shows the full post)

comments.php - this is the file that tells the comment box and comments posted how to be shown

comments-popup.php - this file is only needed if the blog owner decides to use a popup comments box

single.php - this is the file that shows just one post when the permalink is clicked from another page or when someone goes there from a search

page.php - this is the file that shows an individual static page on the blog like the About Me page

category.php - this is the file that will show all all posts in a category and should use the the_excerpt tag and not the_content tag to avoid content duplication

author.php - this is the page that will show the details about an author

archive.php - this is the page that will show a category, an author, or a date and should use the the_excerpt tag and not the_content tag to avoid content duplication

searchform.php - this is the file that holds the form that is the search box, but it is included as a widget now in wordpress 2.5, so you will only need it if your theme is not widget enabled or if you want the search box to be in the main body of your blog and not in a sidebar

search.php - this is the page that will show the search results (you should be monetising this page and changing it every so often as this counts as new content)

404.php - this is the page that will show when someone does a search for a page that is not there (you should be monetising this page and changing it every so often as this counts as new content)

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(); ?>

My First Custom Niche Theme For Wordpress

Well, if you have been following me here you will have seen the small changes taking place every day to my chosen theme, but I finally finished my first custom niche theme for wordpress with a widgetized sidebar and I am very proud :) You can take a look at it here.

My free theme will be slightly different to this because it will be slightly larger, and generic obviously, (your blog may not be about toys … lol) will hopefully be finished by Thursday next week as I am off to London for a week to visit my family on Friday next week and I want to be able to relax. I can post from there and check my e-mails (remotely) so I will probably not take my laptop as it is supposed to be a holiday, but you never know, I might change my mind at the last minute :)

I will be creating niche blog themes and selling them from this site, so please do let me know if you have a niche in mind. They will automatically include clickbank, adsense and amazon. The first ones will probably not be ready until I get back from London though unless someone asks for a particular niche to be covered before the end of this weekend.

If you would like a custom niche theme made exclusively for you, please send me an e-mail to admin [at] onthenetdollars.com to discuss pricing. (replace the [at] with the @ sign)

Also, do you like the cool little corner image that allows you to add the site to your google toolbar with one click? I love it and it is a great little plugin that is easy to install and configure. You can grab a copy for yourself here, it is called WP Goobar and for just $20 (you can add it to an unlimited number of your wordpress blogs) it is worth every cent in my opinion. If you do purchase through my link and have any installation problems, let me know and I will help you get it working.