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

            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 {

  • 写回答

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.

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



    • ¥15 关于#c++#的问题:c++如何使用websocketpp实现websocket接口调用,求示例代码和相关资料
    • ¥15 51单片机的外部中断,按下按键后不能切换到另一个模式
    • ¥15 java连接sqlserver有问题
    • ¥15 yolov8 如何调cfg参数
    • ¥15 这个四人抢答器代码哪儿有问题?仿真程序怎么写?
    • ¥15 burpsuite密码爆破
    • ¥15 关于#ubuntu#的问题,如何解决?(相关搜索:移动硬盘)
    • ¥15 scikit安装之后import不了
    • ¥15 Ros2编译一个使用opencv的c++节点的时候,报了这个错误,请问怎么解决啊
    • ¥15 人脸识别相关算法 YOLO,AI等