webpopular.net dark logo webpopular.net light logo webpopular.net mobile dark logo webpopular.net mobile light logo
  • Home
  • Services
    • Website Consulting
    • Website Design
    • WordPress Development
    • Search Engine Optimization
      • Search Engine Optimization
      • SEO Company Audit
      • Free SEO audit
      • Enterprise SEO audit
      • SEO technical audit service
      • WordPress SEO consultant
    • Social Media Marketing
    • ADA Web Development Compliance
    • Enterprise ADA Web Development Compliance
    • WordPress Maintenance & Support
    • WordPress Security
    • Web Hosting
  • Portfolio
  • Blog
  • Contact Us
  • (214) 282-3530

How to Create a Custom WordPress Template

    Home Web Development How to Create a Custom WordPress Template
    NextPrevious

    How to Create a Custom WordPress Template

    A webpopular.net

    article by: Justin| Web Development| 0 comments| 30 November, 2021| 0
    1. In order to create the template file itself open a text editor such as Visual Studio Code and paste the following code in the editor in a new, blank file : <?php /* Template Name: Blog Template with Sidebar */ ?> then save the file with the file extension “.php”.
    2. Upload the newly created template php file to your FTP server in the “/wp-content/themes/Blog Template with Sidebar” folder. If you have a child theme upload the template to that folder instead.
    3. To check if your created template is working go to Word Press Admin click on Pages then Add New, after that on the right side under Template choose your newly created template from the menu, for example in the dropdown instead of “Default Template” choose “Blog Template with Sidebar”(The name of the template you created)
    4. To make your newly created template display content use this example:
    
    <?php /* Template Name: Blog Template with Sidebar */ ?>
    <?php get_header(); ?>
    <div id="primary" class="content-area">
    <?php 
      // Start the loop. 
      while ( have_posts() ) : the_post(); 
        // Include the page content template. ?>
        <div class="content">
          <div class="title"><?php the_title(); ?></div>
          <div class="excerpt"><?php the_excerpt(); ?></div>
        </div><?php
      // End of the loop. 
      endwhile; ?>
    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
    
    How-to, templates, wordpress

    Leave a Comment

    Cancel reply

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

    NextPrevious

    We are webpopular.net

    Our team is ready to help you get started improving your business. We are here to help, whether you need a website created to reach a bigger audience, increase SEO for your site, or you simply want to improve your web design. We have a wide variety of services to cater to your needs!

    Recent Posts

    10 proven ways to grow your site traffic 2021

    How to increase website traffic: a case study

    Tips on getting more organic traffic to your site

    Best free stock music sites for commercial use 2021

    Services

    Website Consulting

    Website Design

    WordPress Development

    Search Engine Optimization

    SEO Company Audit

    Social Media Marketing

    ADA Web Development Compliance

    Enterprise ADA Web Development Compliance

    WordPress Maintenance & Support

    WordPress Security

    Web Hosting

    Contact Us

    Facebook Twitter LinkedIn Instagram

    Feel free to email us, call us, or fill out the form on our Contact page for more information.

    Phone: 214-282-3530
    Email: bbass@webpopular.net

    Copyright © 2022 | All Rights Reserved

    webpopular.net logo
    • Home
    • Services
      • Website Consulting
      • Website Design
      • WordPress Development
      • Search Engine Optimization
        • Search Engine Optimization
        • SEO Company Audit
        • Free SEO audit
        • Enterprise SEO audit
        • SEO technical audit service
        • WordPress SEO consultant
      • Social Media Marketing
      • ADA Web Development Compliance
      • Enterprise ADA Web Development Compliance
      • WordPress Maintenance & Support
      • WordPress Security
      • Web Hosting
    • Portfolio
    • Blog
    • Contact Us
    • (214) 282-3530
    webpopular.net mobile logo