Hallo zusammen,
ich baue ein neues Template auf und lese mich seit drei Tagen durch die Dokus, finde aber nicht wirklich Antworten auf meine Fragen:
Ich habe Wordpress localhost (Die berühmte Fünf-Minuten-Installation) installiert. Im /themes Ordner waren nach der Installation 2 Templates vorhanden: default + classic.
Ich habe einen weiteren Ordner hinzugefügt: test
Ich habe mein vorhandenes HTML-Layout (unten vollst. Quelltext) genommen und in drei Teile unterteilt:
index.php
header.php
footer.php
Anhand der zwei vorh. Templates (default + classic) habe ich die Template Tags übernommen:
index.php
<?php
get_header();
?>
<body>
<table border="0" cellspacing="0" cellpadding="0" class="kopf">
<tbody>
<tr>
<td><img src="gfx/kopf/logo.gif" width="170" height="120" /></td>
<td><img src="gfx/kopf/banner.gif" width="590" height="120" /></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0" class="navi">
<tbody>
<tr>
<td class="navi">
<?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?>
</td>
<td class="header"><img src="gfx/kopf/image.jpg" width="590" height="139" /></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0" class="inhalt">
<tbody>
<tr>
<td class="links">
<?php get_sidebar(); ?>
</td>
<td class="rechts">
<?php the_date('','<h2>','</h2>'); ?>
<p>
<?php the_content(__('(more...)')); ?>
</p>
</td>
</tr>
</tbody>
</table>
<?php get_footer(); ?>
Alles anzeigen
header.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="imagetoolbar" content="no" />
<title>Test</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
footer.php
Die Template Tags habe ich aus den vorhandenen Templates "gestohlen", ich vermute mal das diese für mein eigenes Template nicht korrekt sind? sidebar.php fehlt wahrscheinlich ..?
Wie sieht der korrekte Aufbau eines Templates aus. Mein größtes Problem: Wie kriege ich eine Navigation in mein Template?
Ich habe mein Template in der Adminsistration aktiviert. Das Template wird so im Browser (Quelltext) angezeigt:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="imagetoolbar" content="no" />
<title>Test</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head><body>
<table border="0" cellspacing="0" cellpadding="0" class="kopf">
<tbody>
<tr>
<td><img src="gfx/kopf/logo.gif" width="170" height="120" /></td>
<td><img src="gfx/kopf/banner.gif" width="590" height="120" /></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0" class="navi">
<tbody>
<tr>
<td class="navi"> </td>
<td class="header"><img src="gfx/kopf/image.jpg" width="590" height="139" /></td>
</tr>
</tbody>
</table>
</body>
</html>
Alles anzeigen
Mein "Layout", dass ich gern als Template aufbauen möchte sieht so aus:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="imagetoolbar" content="no" />
<title>Titel</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellspacing="0" cellpadding="0" class="kopf">
<tbody>
<tr>
<td><img src="gfx/kopf/logo.gif" width="170" height="120" /></td>
<td><img src="gfx/kopf/banner.gif" width="590" height="120" /></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0" class="navi">
<tbody>
<tr>
<td class="navi">Main Navigation (5 Punke)</td>
<td class="header"><img src="gfx/kopf/image.jpg" width="590" height="139" /></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0" class="inhalt">
<tbody>
<tr>
<td class="links">Sub Navigation</td>
<td class="rechts">Seiten-Inhalt</td>
</tr>
</tbody>
</table>
<div id="footer">footer infos</div>
</body>
</html>
Alles anzeigen
Wie muss das Template korrekt aufgebaut werden damit ich eine vollständige Ausgabe im Browser erhalte, und - wie füge ich eine Navigation hinzu???
Danke!