Trouble with creating custom template
-
Okay, I’ve installed WordPress 1.5. I’ve added posts and viewed them using the default theme perfectly. The trouble starts when I try to create my own template using WP functions.
I have a site design which I’ve been working on but is not yet complete, and I wanted to try to figure out how to get the blog working before I continue. I’ve inserted all the include functions for header, footer, etc. into index.php and I’ve used the loop (or attempted to anyway) to try and display the two posts which I’ve written along with some other tags for displaying various bits of info like a permalink and the date.
The problem is that when I view it, nothing appears. The screen is blank and the source is simply “
<html><body></body></html>
” (which differs from Firefox’s default which includes a doctype…if that helps any). Now this question may have already been answered, but I’ve used the search and I’ve been poring over the wiki documentation, and though my knowledge of PHP is limited, I’ve done my best to figure out what I’m doing wrong.I’m pretty sure it has to do with the PHP I’ve inserted and having done that incorrectly. Any information would be much appreciated.
Here is the code of my index.php file:
<?php define('WP_USE_THEMES', false); ?>
<?php get_header(); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="post">
<h2><?php the_title(); ?></h2>
<p class="postdata">
<a> rel="bookmark" title="Permanent Link to "<?php the_title(); ?>">Read it all...</a>
<span>Placed in<a href="#3434"><?php the_category(', '); ?></a></span>
<span class="date">
<span class="month"><?php the_time('M'); ?></span>
<span class="day"><?php the_time('j'); ?></span>
<span class="time"><?php the_time('g:i a'); ?></span>
</span>
<?php the_content(); ?>
</div>
<?php endwhile; ?>
<?php
get_sidebar();
get_footer();
?>
P.S. Where am I supposed to put the .htaccess file in my site’s directory structure? The root? The wordpress folder? Alongside my blog’s files?
- The topic ‘Trouble with creating custom template’ is closed to new replies.