Recently I was working on one of my new websites and wanted to add Adsense Code in my sites header.php (so that it could be reviewed and approved for monetization). Suddenly, all my header.php scrip got deleted and my website was nothing more than a boring text page like.

php header deleted - Tech Urdu 
header.php

The header.php of my site got deleted completely. Though I solved my problem yet I wanted to share my methods with you so that you can get through such a problem without any worries.

Keep it in mind these methods work for Missing or Deleted Header.php, Functions.php, Footer.php, Comments.php and other .php files.

Scroll Down for detailed instruction Video

Missing or Deleted Header.php, Functions.php, Footer.php and other .php Theme Files

Working on a website, blog especially working with a WordPress site, you at times come across with .php files. Now if you don't know/understand coding (HTML, CSS, Java, etc), then it becomes really problematic to solve missing/deleted .php files problem.

Also Read: How to Trace Mobile Number Exact Location?

Here I have discussed three methods using these you can get over such a coding problem. Remember, Developers charge for such works on your website. So, why not learn these easy steps and do it yourself.

Changing the Theme Completely

Well, since your current theme .php files got deleted, it becomes really hard to get those right (if you don't know to code). Then there is a very simple method - just install and activate a new theme.

add new wordpress theme - Tech Urdu

Remember, once you install the new theme you need to make all setting from the beginning to match the layout of the new theme.

By Copying .php Code from another Similar Theme

Now this one is very interesting. If you use the same theme for two different websites, then copy the .php file of the one and paste it into the deleted files. This method is not a sure solution as in some cases very few coding is needed to match the new site.

php theme - Tech Urdu header.php of the theme

So if you know some basics of php then this method will work for you. The advantage of this method is that you will get your current theme back - no need to install any new themes.

By Installing a new Fresh 'Same' Theme

If you want to get your current favorite theme at all costs (and don't want to try a new theme and don't know the even basics of coding), then you this one is for you.

All you need to do activate any theme available and delete the theme you want to apply for your website. Once deleted, re-install the theme by any method. Activate it and bingo you got it back. Now just make some customizations and you are good to go.


Read Next: Top 10 Most Sold Phones of All Time.

Let me know in comments below which method works/worked for you. Add any other method you think is easy to do.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.

| Designed by Colorlib