Site icon T4Tutorials.com

How to manually create a full width homepage in wordpress?

How to manually create a full width homepage in wordpress?

Step 1:

Open the wordpress folder where its installed.

Step 2:

Go to WP Contents -> WP – Themes folder

Step 3:

Chose your desired theme and create a file with name as "full-width-template.php"

Step 4:

Add the following code in "full-width-template.php".

<?php
/* Template Name: Full Width */
get_header(); ?>

<div id="primary" class="content-area">
    <main id="main" class="site-main">
        <?php
        while (have_posts()) :
            the_post();

            get_template_part('template-parts/content', 'page');

        endwhile; // End of the loop.
        ?>
    </main><!-- #main -->
</div><!-- #primary -->

<?php
get_footer();

Step 5: Optional

Assign full width template to any post or page in WP admin panel and publish or update the page.

manually create a full width homepage in wordpress

Step 6: 

Open your page and enjoy.

Note: if page looks empty then you can insert page.php or post.php code in between the code of "full-width-template.php".

Exit mobile version