shinobi168
Joined: 15 Mar 2004 Posts: 9 Location: Indiana
|
Posted: Fri May 07, 2004 12:49 am Post subject: |
|
|
To make your own template, the file has to be PHP. If you're coding in Notepad, select file type -> All Files then put a .php extension to make it PHP.
These are the PHP tags you need in your custom template:
Code: |
<?php /* Don't remove this line, it calls the b2 function files ! */ $blog=1; include ("blog.header.php"); ?>
<link rel="stylesheet" type="text/css" media="print" href="print.css">
<link rel="alternate" type="application/rdf+xml" title="RDF" href="<?php bloginfo('rdf_url'); ?>">
<link rel="alternate" type="application/rss+xml" title="RSS" href="<?php bloginfo('rss2_url'); ?>">
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>">
<?php comments_popup_script() ?>
<?php while($row = mysql_fetch_object($result)) { start_b2(); ?>
<?php the_title(); ?>
<?php the_date("m.d.y","",""); ?>
<?php permalink_anchor(); ?>
<?php the_content() ?><?php link_pages("<br>Pages: ","<br>","number") ?>
<a href="<?php comments_link() ?>"><?php comments_number("0 Comments","1 Comment","% Comments") ?></a>
<?php include ("b2comments.php"); ?>
<?php } ?>
|
Now for the explaination...
<?php /* Don't remove this line, it calls the b2 function files ! */ $blog=1; include ("blog.header.php"); ?> Put that above your HTML tag. It starts all the b2 crap.
<link rel="stylesheet" type="text/css" media="print" href="print.css">
<link rel="alternate" type="application/rdf+xml" title="RDF" href="<?php bloginfo('rdf_url'); ?>">
<link rel="alternate" type="application/rss+xml" title="RSS" href="<?php bloginfo('rss2_url'); ?>">
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>">
<?php comments_popup_script() ?> Put that in between your Head tags.
<?php while($row = mysql_fetch_object($result)) { start_b2(); ?>
<?php the_title(); ?>
<?php the_date("m.d.y","",""); ?>
<?php permalink_anchor(); ?>
<?php the_content() ?><?php link_pages("<br>Pages: ","<br>","number") ?>
<a href="<?php comments_link() ?>"><?php comments_number("0 Comments","1 Comment","% Comments") ?></a> That's your blog. Put it all in between your Body tags.
<?php the_title(); ?> is the title of your post.
<?php the_date("m.d.y","",""); ?> is the date. The lower-case letters show 2 digit representation of the date (d being day, etc.). You can change that to whatever you want. There are also tags for time, if you so desire. The periods in between the letters (m.d.y) separates each letter with a period. Again, changeable.
<a href="<?php comments_link() ?>"><?php comments_number("0 Comments","1 Comment","% Comments") ?></a> Comments link. The only thing you need to change is all the "1 Comment" etc. stuff. If you care for it to say different things.
The other stuff above the Comment tag, don't mess with.
<?php include ("b2comments.php"); ?>
<?php } ?> The first tag calls the comments page. This isn't the popup comments (I have no idea how to get that) so if you want that, you'll have to ask someone else. The very last tag (<?php } ?>) is incredibly important: it closes the b2 crap. That's the end of the blog. Integrate this into HTML and viola, you have your own template! _________________ shinobi168
I'm not in the business of faking to please vain opposers
A dead legion of new, cloned followers
Fake Sky |
|