dongxu2398 2017-11-21 22:24
浏览 79
已采纳

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

I want to make wordpress default theme, Twenty-seventeen, pages content to be full width. Below is the content-page.php file in template-parts i am trying to modify. I am not sure if i should modify something else. I should remove the sidebars in order for the content to be full width.

<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-## -->

Thanks to @Dipak i managed to do it with some css:

I suggest to use a page template inside a child theme and modify that template with css. You can also try 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条回答 默认 最新

  • doufubu2518 2017-11-22 04:38
    关注

    Solution 1 :

    Try to remove the sidebars in the template file you are working. This will remove the unwanted sidebars if you want to make your content full width.

    Solution 2 :

    If solution 1 is not the requirement, I believe you want your container to be full width without any padding or margin. Try to find the container area and apply some style to it.

    Sample code will be like following,

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

    Solution 3 :

    If above solutions are not helpful then you might want a particular solution to this. And that would be a Child Theme.

    There is a nice blog written on how to extend your Twenty Seventeen by its Child Theme. This will be very helpful to you. Check out this article.

    How To Master Twenty Seventeen

    Hope this helps.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 帮我写一段可以读取LD2450数据并计算距离的Arduino代码
  • ¥15 C#调用python代码(python带有库)
  • ¥15 矩阵加法的规则是两个矩阵中对应位置的数的绝对值进行加和
  • ¥15 活动选择题。最多可以参加几个项目?
  • ¥15 飞机曲面部件如机翼,壁板等具体的孔位模型
  • ¥15 vs2019中数据导出问题
  • ¥20 云服务Linux系统TCP-MSS值修改?
  • ¥20 关于#单片机#的问题:项目:使用模拟iic与ov2640通讯环境:F407问题:读取的ID号总是0xff,自己调了调发现在读从机数据时,SDA线上并未有信号变化(语言-c语言)
  • ¥20 怎么在stm32门禁成品上增加查询记录功能
  • ¥15 Source insight编写代码后使用CCS5.2版本import之后,代码跳到注释行里面