123ArticleOnline Logo
Welcome to 123ArticleOnline.com!
ALL >> Computer-Programming >> View Article

The Anatomy Of Wordpress Theme

Profile Picture
By Author: Alex Smith
Total Articles: 2
Comment this article
Facebook ShareTwitter ShareGoogle+ ShareTwitter Share

Do you know how a WordPress themes works? Did you think ever all those files in your WordPress theme folder do? This passage on anatomy of WordPress theme gives you the necessary details of it.

Header.php :It is the global file that displays the headers and navigation and containing HTML head code

The loop :The individual template files controls the display of contents of the main area of your website what we call as “the loop”.

The most powerful part of your WordPress theme is the Loop, starting with a query determining which posts or pages to grab and ending with a php “endwhile” statement. Everything in between is left to your choice. You can specify the output of titles, post content, metadata, custom fields and commenting all within the loop etc. Multiple loops and queries can be set on a single page;

A few essential background files are needed for WordPress theme to work. These files can be modified to your needs, and it will powerfully affect the custom look and functionality of your site.

Sidebar.php ...
... : This file controls the sidebar display. Multiple sidebar can be set up in functions.php and the Wordpress wp-admin panel sets the content of the sidebar widgets.

Footer.php: It contains the instructions for global footer and closes HTML tags.

WordPress themes are made up as a folder of template files, each template controls a specific piece of your theme. Parts of your site that remain static no matter what page you are on are controlled by header, sidebar and footer files. You can hack these files so they deduct what page you are on and serve different content accordingly such as displaying different navigation on posts however, it is the most common for these sections to look the same throughout the site.

Index.php : The home page display is cotrolled by this index.php. It contains a loop by default which queries and then displays the most recent blog posts, with a link at the bottom to view the previous posts. You can also specify in wp-admin>settings>read to have the home page be a page you created yourself in WordPress. In that situation, you can specify a different page/URL for the regular blog posts to appear on, and that page is generated by index.php

single.php : All the individual posts display is controlled by a little file called single.php. There is a loop that queries for just one post and displays it.

Page.php :The WordPress pages display are controlled by Page.php. There is provision to eliminate sidebars or other elements or to add other unique elements for the pages alone.

WordPress also supports you to create different page templates for different types of pages. Yu can create a page template by simply copying page.php, then rename it as you like, then add this code to the top.

<?php

/*

Template Name: Your Namehere

*/

?>

Archive.php, category.php, tag.php :If there is no archive file, the archives will look like index.php. You can create an archive.php to override the index.php. Creating a file called category.php will override archives.php for categories only. In the same way, creating a tag.php, will override it for tag archives only.

Comments.php :The output of comments is controlled by this file, which can be included in the loop if you desire comments on your theme. Plugins like Disqus can override this comment.php, which then take over comment functionality.

Functions.php : It allows you to put your own custom php code in order to modify core elements of your theme. To specify multiple sidebars, change the number of characters in the excerpt, or add custom admin panel options from wp-admin this functions.php is used.

Style.css : The main CSS stylesheet for your theme, contaning text at the top which tells WordPress what your theme name is, who the author is, and what the URL of your site is.

The Extras : The Extras like plugins, custom fields, and widgets allow you to customize your site beyond the core functionality of Worpress

Plugins: A major group of open source developers has developed a plethora of plugins which you can freely add on to your theme, includes e-commerce, sideshow and social media wordpress plugins.

Custom fields : Custom fields are special boxes of the main post box in the wp-admin let you create your own options, which will be displayed in the theme. The most Common uses include thumbnail images and javascript includes.

Widgets :Widgets are little modules go in your sidebars. can mix and match preset widgets, and add your own vis plgins or php code. It includes search forms, popular posts lists and advertising blocks also.

Alex Smith is an Author and 10 years of experience in various topics such as like wordpress development, wordpress themes, wordpress plugins, wordpress themes India, wordpress development India etc.

Total Views: 142Word Count: 788See All articles From Author

Add Comment

Computer Programming Articles

1. Agentic Ai Development Services: Unlocking The Future Of Smarter Automation
Author: Albert

2. Why The Best Data Science Institute In Bhopal Is The Gateway To Top It Jobs
Author: Rohan Rajput

3. Complete Php Tutorial: Master Core Php Concepts With Examples
Author: Tech Point

4. Framework7 Tutorial For Beginners – Create Powerful Hybrid Apps
Author: Tech Point

5. Why Spadegaming Is Dominating The Asian Igaming Market
Author: Alex

6. Why Express.js And Mongodb Are A Dynamic Duo For Node.js Development
Author: Andy

7. Discover The Best Data Science Institute In Bhopal For A Future-ready Career
Author: Rohan Rajput

8. Best Data Science Institute In Bhopal: Learn Ai, Ml & Analytics With Experts
Author: Rohan Rajput

9. Jstl Tutorial – Simplifying Jsp Development
Author: Tech Point

10. Easy Java I/o Tutorial For Beginners To Learn File Operations
Author: Tech Point

11. Ai Chatbot Development Vs. Traditional Chatbot Development
Author: Albert

12. Good Schools In Bhopal Offering Academics With All-round Growth
Author: Ronit Sharma

13. Top Data Science Academy In Bhopal
Author: Rohan Rajput

14. Premier Data Science Courses In Bhopal
Author: Rohan Rajput

15. Jsf Tutorial: Everything You Need To Know About Javaserver Faces
Author: Tech Point

Login To Account
Login Email:
Password:
Forgot Password?
New User?
Sign Up Newsletter
Email Address: