当前位置:网站首页>How to fix syntax errors in WordPress websites
How to fix syntax errors in WordPress websites
2022-06-11 02:37:00 【Know blog】

How to repair WordPress Website Syntax Errors Grammar mistakes
If you are in WordPress Station building in , Often try various functions on the website , Then you may receive the following error “Syntax error,unexpected…”, Please do not panic , You're not the first one WordPress People who receive grammatical errors in , It's not the last one .

WordPress There will be all kinds of mistakes in the process of building the site , Make your readers unable to access the website , Although this problem may be annoying , But the error message will indirectly tell you the correct solution , these WordPress error It's usually easy to fix .
All kinds of things on the Internet WordPress course 、 Guidelines and code snippets , Allows users to learn more about WordPress Various information in the process of building the station , however , A small mistake can cause the entire site to crash , This is terrible for new users .
In this paper , We know that the blog will show you how to fix WordPress Website Syntax Errors Grammar mistakes .
What is? Syntax Errors Grammar mistakes ?
<span style="color:#3a3a3a"><span style="background-color:#ffffff"><span style="background-color:#eeeeee"><code><span style="color:#660066"><span style="color:#660066">Parse</span></span><span style="color:#000000"><span style="color:#000000"> error</span></span><span style="color:#666600"><span style="color:#666600">:</span></span><span style="color:#000000"><span style="color:#000000"> syntax error</span></span><span style="color:#666600"><span style="color:#666600">,</span></span><span style="color:#000000"><span style="color:#000000"> unexpected </span></span><span style="color:#000088"><span style="color:#000088">end</span></span> <span style="color:#000088"><span style="color:#000088">of</span></span><span style="color:#000000"><span style="color:#000000"> file </span></span><span style="color:#000088"><span style="color:#000088">in</span></span>
<span style="color:#666600"><span style="color:#666600">/</span></span><span style="color:#000000"><span style="color:#000000">wp</span></span><span style="color:#666600"><span style="color:#666600">-</span></span><span style="color:#000000"><span style="color:#000000">content</span></span><span style="color:#666600"><span style="color:#666600">/</span></span><span style="color:#000000"><span style="color:#000000">themes</span></span><span style="color:#666600"><span style="color:#666600">/</span></span><span style="color:#000000"><span style="color:#000000">astra</span></span><span style="color:#666600"><span style="color:#666600">-</span></span><span style="color:#000000"><span style="color:#000000">child</span></span><span style="color:#666600"><span style="color:#666600">/</span></span><span style="color:#000000"><span style="color:#000000">functions</span></span><span style="color:#666600"><span style="color:#666600">.</span></span><span style="color:#000000"><span style="color:#000000">php on line </span></span><span style="color:#006666"><span style="color:#006666">30</span></span></code></span></span></span>When the command is not written correctly , Will cause grammatical errors .
This may include syntax errors in your site code 、 Misspelled words or missing symbols , Or incorrect punctuation .
In this paper , We know that the blog will show you how to fix WordPress Website Syntax Errors Grammar mistakes .

Syntax Errors Common causes of grammatical errors ?
WordPress Syntax Errors A grammatical error is pointing to WordPress Add code snippets to the website Is very common among users of . This error occurs because the programming language is not used correctly , Not following the rules , The code is wrong .
Like not placing semicolons , Or a complete file misspelled , You won't understand when compiling , There will be that mistake .
As a beginner , When an error makes the entire site inaccessible , It is not uncommon for people to feel depressed soon . If you have passed the editor area in WordPress instrument panel Add code to , You will no longer have direct access to your WordPress Code .
When you paste code incorrectly , Syntax errors may occur . A part of the code is missing when it is copied , Or there is an extra end tag at the end of the script .
This is a PHP label :
<span style="color:#3a3a3a"><span style="background-color:#ffffff"><span style="background-color:#eeeeee"><code><span style="color:#666600"><span style="color:#666600"><?</span></span><span style="color:#000000"><span style="color:#000000">php </span></span><span style="color:#000088"><span style="color:#000088">this</span></span> <span style="color:#000088"><span style="color:#000088">is</span></span><span style="color:#000000"><span style="color:#000000"> a closing tag </span></span><span style="color:#666600"><span style="color:#666600">?></span></span></code></span></span></span>stay WordPress When editing a theme in the customizer , You may also encounter syntax errors . If this happens , You usually know what the problem is , Or at least know where it happens in the file . If you are not sure , Please don't worry . You can do this by wp-config.php file Make some changes to locate the error .
To solve WordPress Grammar mistakes , The part of the code that caused this error must be changed again , Or delete it completely , Or correct the grammar .
How to fix it WordPress Website Syntax Errors Grammar mistakes
Repair WordPress Website Syntax Errors Grammar mistakes , It usually takes two steps :
First, recognize the root cause of the problem , If an error occurs after you have just installed a new plug-in or theme , Then they may be the cause of the problem .
perhaps , You can also trace the root cause of the problem from the error message , It contains the full path to the corrupt file , The error code line is also mentioned .
Let's look at the following syntax error message :

We can see that the error is caused by index.php Of documents The first 72 Line induced . therefore , This is the file you need to modify to fix the syntax errors .
If your site displays a page with no error messages , Please pass FTP Visit the root directory of the website , open wp-config.php file , Add the following code :
<span style="color:#3a3a3a"><span style="background-color:#ffffff"><span style="background-color:#eeeeee"><code><span style="color:#000000"><span style="color:#000000">define</span></span><span style="color:#666600"><span style="color:#666600">(</span></span><span style="color:#008800"><span style="color:#008800">"WP_DEBUG"</span></span><span style="color:#666600"><span style="color:#666600">,</span></span><span style="color:#000000"><span style="color:#000000">ture</span></span><span style="color:#666600"><span style="color:#666600">)</span></span></code></span></span></span>
then , After reloading the site, you can see the error message .
2、 Repair files from file manager
Now that I know Syntax Errors The cause of grammatical errors , Then you know how to fix it :
- You can navigate to htdocs -> wp-content -> themes -> twoseventeen To access this folder .
- Open the damaged file , Then find the line that caused the problem . In the example above , We're going to open up index.php File and edit page 72 That's ok .
- 72 Line missing semicolon , Can be added to .
- Click on Save and close And reload your site .

In some cases , Deleting this line also fixes syntax errors . for example , One comment is missing an escape character , So it is interpreted as code . Deleting this line will fix the error .
Above is Know blog How to repair WordPress Website Syntax Errors The whole content of the grammatical error , In the use of WordPress The theme of building a website when , encounter Syntax Errors Grammatical errors can be frustrating , however , It's very easy to fix grammar errors , All you have to do is identify the corrupt file and modify it from the file manager .
Know blog » How to repair WordPress Website Syntax Errors Grammar mistakes
Reprint please keep the link :https://www.pythonthree.com/how-to-fix-syntax-errors-wordpress/
边栏推荐
- 【189. 轮转数组】
- Byte beating client R & D Intern Tiktok side
- Koa2 learning notes
- Kotlin let方法
- Metal organic framework MOF Al (Diba), MOF Zr (Diba), MOF Fe (Diba) loaded with curcumin / carboxybenzylpenicillin /mtx methotrexate / paclitaxel ptx/ DOX / cisplatin cddp/cpt camptothecin and other d
- SQL | 外连接
- 扁平数据转tree与tree数据扁平化
- Large screen - full screen, exit full screen
- Dynamically add attributes to objects
- Project - redis message queue + worker thread fetches user operation logs and stores them (2)
猜你喜欢

【斐波那契数列】

App test_ Summary of test points

Li Kou brushing questions - hash table

How to read PMBOK guide in 3 steps (experience + data sharing)
![[189. rotation array]](/img/cc/0da616ad9adc9c9d352e54f58dbe41.png)
[189. rotation array]

Istio安装与使用

When the interviewer opens his mouth, he comes to compose. Is this the case now?

Introduction for i-Teams

【冒泡排序的实现】

Write my Ini configuration file error
随机推荐
Project - redis message queue + worker thread fetches user operation logs and stores them (2)
深度学习基础篇【4】从0开始搭建EasyOCR并进行简单文字识别
Common vocabulary of software testing English
English subtitle video translated into Chinese subtitles
CPT 102_LEC 20
SQL | return customer name, relevant order number and total price of each order
A digit DP
STC8A8K64D4 EEPROM读写失败
如何3步精读《PMBOK指南》(经验+资料分享)
CPT 102_LEC 15
Koa2 learning notes
SQL | calculate sum
[AI weekly] AI and freeze electron microscopy reveal the structure of "atomic level" NPC; Tsinghua and Shangtang proposed the "SIM" method, which takes into account semantic alignment and spatial reso
App test_ Summary of test points
靠贴牌飞利浦冲击上市,德尔玛的自有品牌又该如何“起跳”?
那些笑着离开“北上广”的人,为何最后都哭了?
金属有机框架MOF-Al(DIBA),MOF-Zr(DIBA),MOF-Fe(DIBA)包载姜黄素/羧苄西林/MTX甲氨蝶呤/紫杉醇PTX/阿霉素DOX/顺铂CDDP/CPT喜树碱等药物
Unity camera camera about layer mask cullingmask settings
Technology sharing | quick intercom, global intercom
Limiting visibility of symbols when linking shared libraries