2011-08-11 76 views
-1

請原諒我的無知,我對web場景很陌生。我缺少自定義主題上的側邊欄和頁腳。我能夠獲得背景圖像以顯示標題和內容,但不能顯示頁腳和側邊欄。我跟隨了幾個教程,研究了互聯網的兩端,無法弄清楚我做錯了什麼。WordPress - 缺少SideBar和Footer

我正在嘗試創建一個包含標題,內容和右邊欄的佈局。我真的不需要任何東西在我的WordPress欄杆上。我將把網站導航和登錄到那裏,但我希望顯示背景!我將發佈下面的基本代碼,並將鏈接提供給我的網站here。提前致謝!

的index.php

<div id="container"> 
     <div id="content" role="main"> 

     <?php 
     /* Run the loop to output the posts. 
     * If you want to overload this in a child theme then include a file 
     * called loop-index.php and that will be used instead. 
     */ 
     get_template_part('loop', 'index'); 
     ?> 
     </div><!-- #content --> 
    </div><!-- #container --> 

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

的header.php

<!DOCTYPE html> 
<html <?php language_attributes(); ?>> 
<head> 
<meta charset="<?php bloginfo('charset'); ?>" /> 
<title><?php 
/* 
* Print the <title> tag based on what is being viewed. 
*/ 
global $page, $paged; 

wp_title('|', true, 'right'); 

// Add the blog name. 
bloginfo('name'); 

// Add the blog description for the home/front page. 
$site_description = get_bloginfo('description', 'display'); 
if ($site_description && (is_home() || is_front_page())) 
    echo " | $site_description"; 

// Add a page number if necessary: 
if ($paged >= 2 || $page >= 2) 
    echo ' | ' . sprintf(__('Page %s', 'twentyten'), max($paged, $page)); 

?></title> 
<link rel="profile" href="http://gmpg.org/xfn/11" /> 
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo('stylesheet_url');?>" /> 
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> 
<?php 

if (is_singular() && get_option('thread_comments')) 
    wp_enqueue_script('comment-reply'); 

    wp_head(); 
?> 
</head> 

<body <?php body_class(); ?>> 
<div id="wrapper" class="hfeed"> 
<div id="header"> 
    <div id="masthead"> 
      ....... 
    </div><!-- #masthead --> 
</div><!-- #header --> 

<div id="main"> 

的sidebar.php

<div id= "sidebar" class="widget-area" role="complementary"> 

</div><!-- #sidebar --> 

footer.php

</div><!-- #main --> 

<div id="footer" role="contentinfo"> 

</div><!-- #footer --> 

</div><!-- #wrapper --> 

<?php wp_footer(); ?> 
</body> 
</html> 

的style.css

/* 
Theme Name: Mod Theme 
Theme URI: http://www.itssimplydesign.com/wordpress/wp-content/themes/mod_theme/ 
Description: My First Theme 
Version: 1.0 
Author: Jason 
Author URl: http://www.itssimplydesign.com 
*/ 

/* =Layout 
-------------------------------------------------------------- */ 

/* 
LAYOUT: Header, Content and Sidebar 
DESCRIPTION: 
*/ 

body { 
background-color: #e6e9Df; 
} 

#container { 
float: left; 
margin: 0 -240px 0 0; 
width: 100%; 
} 

#header { 
background: url(http://www.itssimplydesign.com/wordpress/wp-content/themes/mod_theme/images/background_main_01.png) no-repeat; 
width: 1000px; 
height: 332px; 

} 

#sidebar { 
background: url(http://www.itssimplydesign.com/wordpress/wp-content/themes/mod_theme/images/background_main_03.png) no-repeat; 
float: right; 
clear: right; 
overflow: hidden; 
width: 300px; 
} 

#content { 
background: url(http://www.itssimplydesign.com/wordpress/wp-content/themes/mod_theme/images /background_main_02.png) no-repeat; 
min-height: 668px; 
width: 700px; 
float: left; 
} 

#footer { 
clear: both; 
width: 100%; 
} 
+0

喲沒有任何腳註代碼。請添加一些內容並加以解決。 – Rikesh

+0

非常好的一點。頁腳工作。側欄是我的主要關注點。任何想法爲什麼背景圖片不顯示? – atomSmasher

+0

同樣的方式sidebaris工作太..plz檢查它 – Rikesh

回答

0

您已經應用上的內容背景,但無所不有頁腳。

您可以切換到頁腳的造型在你的CSS,或者你可以把

<div id="footer" role="contentinfo"> 

</div> 

在#container的了。然後,它將全部包含在同一個div中,並且背景也將應用。

同樣,您也可以在容器中包含這樣的邊欄。

+0

對不起,應該說得更好。有三個背景文件。頁腳實際上沒有背景文件。我現在擁有的文件是標題,它顯示在頂部。其中一個用於顯示左側的內容。還有三分之一,這應該是側邊欄。它應該出現在標題的灰色條的下方,並位於內容的右側。它顯示在頁面信息的媒體下,但不在頁面上。 – atomSmasher

+0

你是對的先生。只需要更多地關注我的風格。感謝您指點我正確的方向。 – atomSmasher