請原諒我的無知,我對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%;
}
喲沒有任何腳註代碼。請添加一些內容並加以解決。 – Rikesh
非常好的一點。頁腳工作。側欄是我的主要關注點。任何想法爲什麼背景圖片不顯示? – atomSmasher
同樣的方式sidebaris工作太..plz檢查它 – Rikesh