ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

What are the files that I need to make WordPress theme , like header.php ?

user-image
تم إضافة السؤال من قبل مستخدم محذوف‎
تاريخ النشر: 2015/01/01
مستخدم محذوف‎
من قبل مستخدم محذوف‎

The strict minimum is:

  1. style.css which will contain the theme information (name, description, author, version, textdomain)
  2. index.php the file that WordPress uses to start forming the display.

 

Optionnaly, you can have header.php, footer.php and sidebar.php, those files will contain the code for the header, the footer and the sidebar and can be included from index.php (or other files I will mention later) using the functions get_header(), get_footer() and get_sidebar(). Doing this will make your index.php easier to use and read and make adding more template files easier.

 

OK, now we have index.php, we know that everything goes through it, but WordPress is smarter than that, it can use other template files for other purposes, like:

  • front-page.php for the homepage
  • page.php for pages
  • author.php for author posts
  • category.php, taxonomy.php, date.php
  • Even more than that

But how does it know which file to load? It does a lookup of some sort that is explained in this graphic, so for example, when you request the page /hello-world which has the id of99, it will look for template files in this order and grab the first one it find and forms the page from that template:

  1. page-hello-world.php
  2. page-99.php
  3. page.php
  4. index.php

 

Ajit Kushwar
من قبل Ajit Kushwar , CCTV Operator , Spark Security Services

Basicaly the below files are needed to you to make your wordpress theme. You can add as much more file as you created the theme.

 

  • header.php
  • footer.php
  • functions.php
  • index.php
  • page.php
  • search.php
  • sidebar.php
  • single.php
  • style.css

Mahmoud Sallam
من قبل Mahmoud Sallam , Web Developer , MSIRED

Files you need to create :

  • header.php ....this file contain you head tags and html of header 
  • Footer.php this file contaim js and footer hml
  • index.php conatin function that include the header and footer and page content
  • style.css....this file contain css classes and import the other file on it
  • page.php ....contain page template 
  • archive.php ...to call your category in separate page 
  • single.php ...this file contain view of your posts 
  •  .. but you should add wordpress licence in all page 

iq mazhar
من قبل iq mazhar , teacher , best college

This is the file that contains the code of header section. Header section is most top section of page. Whenever it is needeed to change the header of a page then change the code written in this file and it automatically change the output of header senction on web. this file is written in a specific language that is PHP. 

مستخدم محذوف‎
من قبل مستخدم محذوف‎

  • header.php - This file will contain the code for the header section of the theme;
  • index.php - This is the main file for the theme. It will contain the code for the Main Area and will specify where the other files will be included;
  • sidebar.php - This file will contain the information about the sidebar;
  • footer.php - This file will handle your footer;
  • style.css - This file will handle the styling of your new theme;

Click Here for source of the above details

المزيد من الأسئلة المماثلة