2017-03-07 38 views
0

我正在尝试为Wordpress 4.7.3上的Zerif Pro创建2个自定义页面模板。012.我已经创建了模板文件,但无法获得我想要的布局。将CSS应用于自定义Wordpress模板

我想要一个全宽模板,其中的内容直接出现在navbar的正下方。

使用检查元素我可以编辑CSS来

.content-left-wrap { 
    padding-top: 0px; 
} 

并获得所需的样子,但我无法弄清楚如何在我的fullwidth.php文件或把它放在哪里改变。

模板下面的代码:

<div class="clear"></div> 
</header> <!--/END HOME SECTION --> 

<?php zerif_after_header_trigger(); ?> 

<div id="content" class="site-content"> 
    <div class="container"> 
    <div class="content-left-wrap col-md-12"> 
     <div id="primary" class="content-area"> 
      <main id="main" class="site-main" role="main"> 

       <?php 
        while (have_posts()) : 
         the_post(); 
         get_template_part('content', 'page-no-title'); 
         /* If comments are open or we have at least one comment, 
         load up the comment template */ 
         if (comments_open() || '0' != get_comments_number()) : 
          comments_template(); 
         endif; 
        endwhile; 
       ?> 

      </main><!-- #main --> 
     </div><!-- #primary --> 
    </div><!-- .content-left-wrap --> 
</div><!-- .container --> 

<?php 
    get_footer(); 
?> 

回答

0

编辑fullwidth.php另一个类添加到这个div喜欢使用新的类此

<div class="content-left-wrap wrap-new col-md-12"> 

,然后添加CSS到模板的css文件

.wrap-new 
{ 
.content-left-wrap { 
padding-top: 0px; 
} 

}