2012-10-04 137 views
1

我已經創建了一個使用斯塔克斯特從頭開始自定義主題以獲得靜態wordpress版本沒有帖子/評論。另外,我在Wordpress中添加了六個頁面,內容是一些單詞。WordPress的:加載頁面內容到自定義模板/主題

因此,設計工作到現在爲止,但我無法獲得加載到網站/瀏覽器的那些頁面的內容。一個DIV在header.php中打開,並在footer.php中關閉,我想,內容會在兩者之間加載。

這就是沿用到現在:

的index.php:

<?php get_header(); ?> 
<?php get_footer(); ?> 

page.php文件:

<?php get_header(); ?> 
<?php the_content(); ?> 
<?php get_footer(); ?> 

的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"> 
<head> 
<title><?php bloginfo('name'); ?><?php wp_title('|'); ?></title> 
<meta charset="<?php bloginfo('charset'); ?>" /> 
<meta name="viewport" content="width=device-width, initial-scale=1.0"><!-- REmove if you're not building a responsive site. (But then why would you do such a thing?) --> 
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> 
<link rel="shortcut icon" href="<?php echo get_stylesheet_directory_uri(); ?>/img/favicon.ico"/> 
<?php wp_head(); ?> 
</head> 
<body <?php body_class(); ?>> 
<div id="oben"></div> 
<div id="naviwrap"> 
<div id="titel"><h1 class="titelbutton"><a href="http://www.studio-scs.de">Coach</a></h1></div> 
<div id="navigation"> 
<a class="navibutton" href="/" title="START">START</a> 
<a class="navibutton" href="/coaching/" title="COACHING">COACHING</a> 
<a class="navibutton" href="/termine/" title="TERMINE">TERMINE</a> 
<a class="navibutton" href="/person/" title="PERSON">PERSON</a> 
<a class="navibutton" href="/kontakt/" title="KONTAKT">KONTAKT</a> 
<a class="navibutton" href="/impressum/" title="IMPRESSUM">IMPRESSUM</a> 
</div> 
</div> 
<div class="clearer"></div> 
<div id="wrap" class="inhaltverlauf"> 
<div id="blocker"></div> 
<div id="inhalt"> 

頁腳.php:

</div> 
<div class="clearer"></div> 
</div> 
<div id="farbhintergrund" class="farbverlauf"></div> 
<?php wp_footer(); ?> 
</body> 
</html> 

你可以看看在這裏:studio-scs.de


埃利亞斯對我幫助很大,但剩下一個其他問題。隨着

page.php文件

<?php get_header(); ?> 

<?php if (have_posts()) : while (have_posts()) : the_post();?> 
<?php the_content(); ?> 
<?php endwhile; endif; ?> 

<?php get_footer(); ?> 

我已刪除了所有的帖子,我想,但如果我現在想有崗位能力回到這些頁面的只是一個(例如Termine)有添加新日期等的可能性,我該怎麼做?

回答

1

如果沒有查詢,則不能使用the_content

用以下內容替換你的行the_content()

<div id="content" class="widecolumn"> 
<?php if (have_posts()) : while (have_posts()) : the_post();?> 

<h2 id="post-<?php the_ID(); ?>"><?php the_title();?></h2> 

    <?php the_content(); ?> 


<?php endwhile; endif; ?> 
<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?> 
</div> 
+0

太謝謝你了。不幸的是,我還有一個問題(見上文)。 – vega

相關問題