We help IT Professionals succeed at work.

How do you find which file is being used to generate output in WordPress?

sabecs asked
Last Modified: 2017-04-23
When I view a job category on my website using a link
it displays a sidebar and no footer menu.

How can I work out which file is being called from viewing source code?
And how would I remove the sidebar and add a footer menu that is displayed on the rest of my website?
Watch Question

Banshi lal dangiFull Stack Developer

For categories, WordPress looks for the category-{slug}.php file. If it doesn’t exist, WordPress then looks for a file for the next hierarchical level, category-{ID}.php, and so on. If WordPress fails to find any specialized templates or an archive.php template file, it reverts to the default behavior, using index.php.

The category hierarchy is listed below:

  1. category-{slug}.php: For example, if the category’s slug is named “news,” WordPress would look for a file named category-news.php.
  2. category-{ID}.php: For example, if the category’s ID is “6”, WordPress would look for a file named category-6.php.
  3. category.php
  4. archive.php
  5. index.php


Thanks, I can't see any category or archive files, would they be in my themes folder?  please refer attachedfile list
Banshi lal dangiFull Stack Developer

If there is no any category file, it means Index.php is being used there.


Thanks Banshi for your help, very much appreciated.
If I was to copy index.php from my Divi folder and call it category.php and place it in my child theme and edit as I like would that be called?
Full Stack Developer
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)


Thanks again for your help.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions