当前位置:网站首页>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/
边栏推荐
- 378. the k-th smallest element in an ordered matrix
- Executeineditmode property details
- Optimized dispatching (thermal power, wind energy and energy storage) [matlab code implementation]
- Unity3d model skin changing technology
- CPT 102_LEC 15
- MySQL备份与恢复
- 剑指 Offer II 079. 所有子集
- 1031. maximum sum of two non overlapping subarrays
- Kotlin let method
- What can the enterprise exhibition hall design bring to the enterprise?
猜你喜欢

【AI周报】AI与冷冻电镜揭示「原子级」NPC结构;清华、商汤提出「SIM」方法兼顾语义对齐与空间分辨能力

What can the enterprise exhibition hall design bring to the enterprise?

Koa2 learning notes

app 测试 常用 adb 命令集合

【斐波那契数列】

A collection of common ADB commands for app testing
![Fundamentals of deep learning [4] build easyocr and carry out simple character recognition from 0](/img/e5/31ad2023def9e1a4a5fccb19b31d02.png)
Fundamentals of deep learning [4] build easyocr and carry out simple character recognition from 0

Tests logiciels vocabulaire commun anglais

【冒泡排序的实现】

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
随机推荐
GCC C内联汇编
Istio安装与使用
Kotlin apply method
PHP starts OpenSSL and reports OpenSSL support=> disabled (install ext/openssl)
【新晋开源项目】动态配置化任务编排框架 Gobrs-Async 加入Dromara开源社区
Jetpack compose scaffold and bottomappbar (bottom navigation)
Web watermark
多级介孔有机金属骨架材料ZIF-8负载乳酸氧化酶(LOD)/四氧化三铁(Fe304)/阿霉素DOX/胰岛素/cas9蛋白/甲硝唑/大黄素甲醚
Large screen - full screen, exit full screen
CPT 102_LEC 13-14
Navicat Premium 15 工具自动被杀毒防护软件删除解决方法
Setting access to win10 shared folder without verification
When a logical deletion encounters a unique index, what are the problems and solutions?
Li Kou brushing questions - hash table
421. maximum XOR value of two numbers in the array
企业展厅设计能为企业带来什么?
Sd3.0 notes
helm 部署traefik ingress
Multilevel mesoporous organometallic framework material zif-8 loaded with lactic acid oxidase (LOD) / ferric oxide (Fe304) / doxorubicin / insulin /cas9 protein / metronidazole / emodin methyl ether
[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