如何制作二十七页内容全宽

时间:2017-11-21 22:24:10

标签: php css wordpress themes

我想制作wordpress默认主题,二十七,页面内容为全宽。下面是我试图修改的模板部分中的 content-page.php 文件。我不确定我是否应该修改其他内容。我应该删除侧边栏,以使内容为全宽。

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <header class="entry-header">
        <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
        <?php twentyseventeen_edit_link( get_the_ID() ); ?>
    </header><!-- .entry-header -->
    <div class="entry-content">
        <?php
            the_content();

            wp_link_pages( array(
                'before' => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ),
                'after'  => '</div>',
            ) );
        ?>
    </div><!-- .entry-content -->
</article><!-- #post-## -->
  

感谢@Dipak我设法用一些 css

     

我建议在子主题中使用页面模板,然后使用css修改该模板。您也可以尝试this ready made full width template

@media screen and (min-width: 1200px) {
 /* For devices with more than ore equal to 1200px width */
    .wrap {

        max-width:100%!important;
    }
}

1 个答案:

答案 0 :(得分:1)

解决方案1:

尝试删除您正在使用的模板文件中的侧边栏。如果你想让你的内容全宽,这将删除不需要的侧边栏。

解决方案2:

如果解决方案1不是要求,我相信您希望您的容器是全宽的,没有任何填充或边距。尝试找到容器区域并对其应用一些样式。

示例代码如下,

#primary .entry-content {
  width: 100% !important;
}

解决方案3:

如果上述解决方案无效,那么您可能需要一个特定的解决方案。这将是Child Theme

有一篇关于如何通过其儿童主题扩展你的二十七岁的博客。这对你很有帮助。看看这篇文章。

How To Master Twenty Seventeen

希望这有帮助。

相关问题