Showing “Parse error: syntax error, unexpected ‘<' " In WordPress - Solution

Spread the love

While editing the code and after saving the codes this error “Parse error: syntax error, unexpected ‘<‘in /home/nick/public_html/linkwars/function.php on line 448 it may show.This error shows when there is some problem in your PHP coding.Many people will answer you that this error is because when you use the ?> code and you do not use the starting <? php. This is right in a sense.But in WordPress this kind of error shows when there is some coding error in the .php file.So, they only way is to correct the error.

When the error shows in your WordPress screen, it makes you very scary.Because at that time you cannot log in to your WordPress admin panel.So, this is very scary for you when you just see the lines “Parse error: syntax error, unexpected ‘<‘ ” .But do not get scared.Where there is a problem, there is also a solution. So, this problem is also having its own solution.This problem happens when you change some code in the .php file and there is some error in the code and you try to save it with the error.

I tried to edit my function.php file and because of some error i was also getting the same error message.But i was able to solve it.You will also be able to solve it.Just Follow the below steps.I must tell another blog name which helped me a lot to make the solution.The blog name is BlogWeb6.

The full error message is like below:

Parse error: syntax error, unexpected ‘<‘ in /home/webinternet/public_html/(your website)/wp-content/themes/youthemename/functions.php on line 450

Do not panic at all after getting this error.You will be able to solve it.May be you can think that your whole blog coding is just broken down.But the thing is not like that.

There are many ways to solve the error:

Solution 1:

First of all download one function.php file which is fresh .You can get the fresh codes from here. And then upload it.This much i have learnt from the WebBlog 6 but they did not mention where to up load it.The answer is you need to upload it through your control panel or cPanel.

2. I am sure that you are having one hosting service provider.Go to the cPanel of your host service provider and then Go to “File Manager” option.

3.As i am using Hostgator as my web hosting service i am explaining the procedure for Hostgator cPanel.But i think the functions will be more or less same for all the hosting service cPanel.

  • At first click on the “File Manager” which you will get in the “Files” tab like the below picture
Hostgator_File_Manager

Hostgator _File_Manager

 

  • Then you will get one pop up window and just click on “Go”.This pop up window asks whether you want to go to root.As it is set default as Root , you do not need to change anything.Just “Go”
  • Then you will get the a screen and you need to click on “Public_html” which is in the left side of the window.Then click on “wp-content” and then click on “Themes”.Now you will get your themes.As my theme was twenty eleven, i just clicked on that and got my files on the right hand side.
  • Then look for the function.php file on the right hand side and in the upper tab you will see one tab named “Edit code”.Now click on it and replace all the codes with the codes which you have got as default .You can also get it from here.Copy all these codes and paste in the control panel screen and save it.You will get screen like below:

 

Hostgator_code_editor

Hostgator_code_editor

Now you can check your website and i hope that you will be able to log in through your WordPress admin panel.

 Solution 2: (This is for advance user having coding knowledge)

If you are getting the error message and you can still go back and change the code in the function.php then just look for that line and remove it and check whether you can save it or not.Or just check on the line which is indicated in the error message and check whether there is any error or not.

Solution 3:(This is specially for the begineers)

This is for the beginners only.Just go to your cPanel of your host service provider.Then go to the File manager which is shown in the solution 1 and then click it and then go to wp-content.Then look for the theme name.Like for my case it was written as Twenty eleven.If you get your theme name just rename it.You will get the rename option on the upper tab of the window.After doing this you will see that everything is set to default and you will be able to log in to your blog through your admin panel.

Though i have expressed all the three solution but i think that the Solution 1 is the best of all and it makes only little change of your blog and theme.So, try to follow solution one.

Please share it and leave your comment if you think that this post is helpful for you.Thanks for reading.

Leave a Reply