The problem is that all the pages have a content_container
of a set width of 1056px and I want all pages to have the 1056px set width except for the home page in which I need a content container that spans over the whole page from left to right.
问问题
48 次
3 回答
0
你也可以这样做:
<?php
if ( is_home() ) {
//This is Home page
echo '<div id="content_container_wide">';
}
else {
// This is not a homepage
echo '<div id="content_container">';
}
?>
于 2013-07-18T20:29:37.410 回答
0
查看 WP 在任一页面上使用的 BODY 标签上的 CSS 类。针对您想要的页面编写您自己的 CSS。
于 2013-07-18T20:20:48.057 回答
0
body
向所有文件 (index.php
和)添加一个类,page.php
如下所示:
<body <?php body_class(); ?>>
然后用css定位主页:
body.home #content_container{width:100%; !important}
#content_container{width:1056px;}
于 2013-07-18T20:22:42.373 回答