访问Wordpress functions.php

So the title is pretty self-explanatory. I need to access functions.php in wordpress because Wordpress is adding random p and br tags and it's messing up my code. Searched for over an hour and nothing worked:

What I have tried:
1) Connecting via FTP (which isn't viable, long story)
2) Going to Appearance > Editor, which isn't showing. I have searched this issue up as well, and the only solution seems to be deactivating plugins, which I have tried.
3) deleting all my code, then pasting it all in
4) Ctrl + f5
5) deleting some of my code, then pasting it again

Websites I've looked at:
https://www.converticacommerce.com/support-maintenance/how-to-edit-functions-php-in-wordpress/
https://www.webnots.com/how-to-edit-functions-php-file-and-add-new-functions-in-wordpress/
https://www.nosegraze.com/edit-functions-php/

All these websites suggest the first two things in the What I have tried list.

If there is another way to stop the p tags, please tell me

dongnai5905
dongnai5905 将我的代码添加到我页面上的文本选项卡中
2 年多之前 回复
du27271
du27271 或者这个wordpress.stackexchange.com/questions/178322/...
2 年多之前 回复
dongwei1895
dongwei1895 可能你的问题不是“如何访问functions.php”但是如何停止wp添加<p>&<br/>。它不是随意做的。它试图保留换行符。可以通过移除wpautop过滤器来关闭它。codex.wordpress.org/Function_Reference/wpautop。人们可以有条件地做到这一点(即在某些情况下)。您可以在自定义主题functions.php或单独的插件中执行此操作。还有一些插件可以帮到你。这篇文章可能有所帮助:stackoverflow.com/questions/33809741/wordpress-wpautop-issue
2 年多之前 回复
dragonlew9876
dragonlew9876 你在哪里添加你的代码?
2 年多之前 回复

1个回答

I understand that you are having issues in accessing your theme's functions.php and not with the code. Write a new plugin (code below) and upload to 'wp-content/plugins' directory and activate it. That's it!

<?php
/*
Plugin Name: Implement wpautop
Version: 1.0.0
Description: Implement wpautop function.
*/

remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );
dtxpz8785
dtxpz8785 聪明! 工作得很好,谢谢你的答案
2 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐