Freelance PHP Developer | Freelance PHP Programmer | PHP Freelance | Freelance Developer | PHP Freelancer | PHP Freelance Developers | PHP Developers | Freelance Developers | PHP Developer

[WordPress] Different Template for Different Page

wordpress-development

Are you facing a problem with different inner page layout and integrating it into WordPress ? If yes than you are at the right place to get a simple solution to overcome from the problem which makes you worried. Using WordPress, you can easily create as many templates styles as you want. By default for single post or page, WordPress calls a single.php file from your WordPress theme’s directory. Now for calling different file, you just need to create a file with different template and you are done. Here i am showing the way to create a file for different template for different page.

1. Go to your WordPress theme’s directory
2. Create new file as per your requirement or
make a clone of single.php and remove sidebar or add sidebar as per requirement.
3. Write a comment at top which defines the template name. Look at below code. This is most important as WordPress is reading comments and process accordingly.

<?php
/**
* Template Name: Single column, no sidebar

4. Now Click on Add Page and look at dropdown of template under Page Attributes. You can find Single column, no sidebar. Look at below image. Select this template for page you want to apply.


5. You are Done.

      
Tweet
You can leave a response, or trackback from your own site.
    PHP Freelance | Freelance Developer | PHP Developer | PHP Freelancer | Freelance Developers | PHP Developers
    Freelance PHP Developer