Ad goes here

Sunday, 10 December 2017

How to create a custom page in WordPress?

How to create a custom page in WordPress?
WordPress allow you to create page and post in a default design, but if you like to design your homepage or other inner pages different from each other then you have to use custom page. In this article, I will show you how to create a custom page in WordPress.

First open your html editor, Notepad or Notepad++ or Sublime Text or anything which you have and create a blank page.

Now access the theme folder ( \wp-content\themes\themename\) and find page.php and open it in your editor, copy everything and paste it in your newly created blank page. Now you can see commented area which you have to remove and add following line to give template name.

<?php /* Template Name: My Custom Page */ ?> 


Now the complete page will be with following code.
<?php /* Template Name: My Custom Page */ 

get_header(); ?>

<div class="wrap">
 <div id="primary" class="content-area">
  <main id="main" class="site-main" role="main">
   <?php
   while ( have_posts() ) : the_post();
    get_template_part( 'template-parts/page/content', 'page' );    
    if ( comments_open() || get_comments_number() ) :
     comments_template();
    endif;
   endwhile; 
   ?>

  </main>
 </div>
</div>
<?php get_footer();



Save the file inside \wp-content\themes\themename\ folder. I have given the file name ‘custom.php’ and you can give the file and template name (Template Name: My Custom Page) as per your choice.

You are almost done and now access your admin section and create a new page from left panel and choose template name – ‘My Custom Page’ from right panel and add content in the editor area and publish it.

Choose WordPress Custom Page Template

The WordPress custom page is ready and you can access the page from your website link. By using this custom page you can separate it from other pages design without affecting entire site design and format.

18 comments:

  1. Thanks for the post.Your article is very informative. I think this article has a lot of details needed, looking forward to your new posts. If your interested in getting the service of website agency then visit Web Design Service Rancho Cucamonga.

    ReplyDelete
  2. You have shared a nice information about how to create a custom page in WordPress. it is perfectly described the process of page creation. If you want to know more about WordPress website development process, visit Professional Designers.

    ReplyDelete
  3. Nice article about WordPress. here, You have very well described the process of the custom page creation in the WordPress. If you are interested to know more about wordpress website design prices, Visit Theportwebdesign.com

    ReplyDelete
  4. This is a nice article here with some useful tips for those who are not used-to comment that frequently. Thanks for this helpful information I agree with all points you have given to us. I will follow all of them.

    Selenium training in Chennai
    Selenium training in Bangalore
    Selenium training in Pune
    Selenium Online training

    ReplyDelete
  5. You know after a hard day I decided to have fun and play games of chance I climbed a bunch of sites and only on this I understood what was happening prosperous play slots now I sit and spend all the time on this site

    ReplyDelete
  6. You receive free support, downloads, themes, etc. And they are also free to install and modify, which makes WordPress so universal and loved.wordpress expert help

    ReplyDelete
  7. No doubt this is an excellent post I got a lot of knowledge after reading good luck. Theme of blog is excellent there is almost everything to read, Brilliant post. Themify review

    ReplyDelete
  8. Now you can see commented area which you have to remove and add following line to give template name. HostGator Coupon Code

    ReplyDelete
  9. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
    Selenium Training in Electronic City

    ReplyDelete
  10. Great Blog! Make this type of posts frequently
    Thanks for the information and keep on updating us regularly.hanks for your information really good and very nice web design company in velachery

    ReplyDelete
  11. This is good site and nice point of view.I learnt lots of useful information.

    Selenium Training in Electronic City

    ReplyDelete
  12. You can join the free orientation at Workday training institutes in Bangalore and they located at Workday training institutes in delhi. It is highly recommendable for you to enroll at Workday training institutes in UK and you can have a great market for jobs in USA so join this wonderful Workday training institutes in USA and in India this Workday training institutes in Noida is really best institute.

    ReplyDelete
  13. I am so happy to found your blog post because it's really very informative. Please keep writing this kind of blogs and I regularly visit this blog. Have a look at my services.
    I have found this Salesforce training in India worth joining course. Try this Salesforce training in Hyderabad with job assistance. Join Salesforce training institutes in ameerpet with certification. Enroll for Salesforce online training in hyderabad with hands on course.  

    ReplyDelete
  14. Great post! I am actually getting ready to across this information, It’s very helpful for this blog. Also great with all of the valuable information you have Keep up the good work you are doing well.
    CRS Info Solutions Salesforce training for beginners   

    ReplyDelete
  15. Myself so glad to establish your blog entry since it's actually quite instructive. If it's not too much trouble continue composing this sort of web journals and I normally visit this blog. Examine my administrations.  
    Read these Salesforce Admin Certification Topics which are really helpful. I read these Salesforce Admin and Developer Certification Dumps and very much useful for me. I recommend this Salesforce Developer Training and Certification Course for you.

    ReplyDelete