【发布时间】:2018-08-25 18:46:40
【问题描述】:
我想创建一个全角背景颜色来显示我网站上一个页面的子部分。类似于此设计中的“我们的价值观”部分,其中 BG 为灰色:https://www.w3schools.com/bootstrap/trybs_theme_company_full.htm
我的主题在页眉中声明 .container 并在页脚中关闭该 .container。
我要编辑的页面是这样的
<div class="content-wrap">
<div class="blog-top">test text - no bg color</div>
<!--This is where I want the full-width background color to start-->
<div id="primary" class="content-area content-area-arch<?php echo $zillah_sidebar_show !== true ? ' content-area-with-sidebar' : ''; ?>">
<main id="main" class="site-main" role="main">
<?php zillah_hook_index_top(); ?>
<?php
/*Setting up our custom query (In here we are setting it to show 12 posts per page and eliminate all sticky posts) */
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
query_posts( array ( 'category_name' => 'featured', 'posts_per_page' => 24, 'paged' => $paged) );
?>
<?php
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
$alternative = $zillah_alternative_layout == true ? $zillah_alternative_layout : '-alternativeblog';
get_template_part( 'template-parts/content' . $alternative , get_post_format() );
endwhile;
the_posts_navigation();
else :
get_template_part( 'template-parts/content', 'none' );
endif;
?>
<?php zillah_hook_index_bottom(); ?>
</main><!-- #main -->
</div><!-- #primary -->
<!--This is where I want the full-width background color to start-->
</div><!-- .content-wrap -->
<?php zillah_hook_index_after(); ?>
我已经注明了我想从哪里开始全角背景颜色。有没有办法在我的 .container 中实现下一个 .container-fluid ,或者是否有关于如何在 WordPress / bootstrap 中自定义页面的这个特定子部分完成这个全角背景的建议?
感谢您的帮助!
【问题讨论】:
标签: css wordpress twitter-bootstrap