Remove the unwanted code from Underscores Theme

Step 7 of Convert Bootstrap 4 Template to Wordpress Theme

This is the Step 7 of Tutorial How to Convert Bootstrap 4 Templates to WordPress Themes . In this step we will remove the code from underscores theme which is not required for our Template Conversion.

# Cleanup Header.php

As the first step, open your header.php file and completely remove the following code from this page.

As a boilerplate code, Underscores has provided with a default header and a content div to put the content. But since we are converting a already existing template into a wordpress theme. We don’t need this code, and hence it is comfortable to remove it.

 

# Cleanup Home Page Template file page-home.php

We created a new file page-home.php by copying page.php . page.php is a default page file provided by underscores to create new template pages.

Open page.php file in your editor and completely remove the div with id primary .

Also remove the function to fetch the sidebar on the page, Since we our single page template don’t have a sidebar.

 

# Cleanup footer.php

Open footer.php file in your editor and completely remove the end of content div, footer section and the end of page div

 

That it ,  with the code cleanup. See you at Step 8 Convert the Hero Section of the Template into Dynamic WP.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: