WordPress Background Edit the article will automatically delete the extra space, that is, you in the background to edit the article when some of the space and line change in the foreground are invisible, are ignored by WordPress, today to talk about how to add the first line of all articles indent:
Method One:
Online code, I have not tried.
Add the following code to the functions.php:
| 12345 |
//wordpress article first line indent Code class= "PHP keyword" >function bing_paragraph_indentation ( $content ) { return str_replace ( ' <p ' ' <p style= "TEXT-INDENT:2EM;" ' $content } add_filter ( ' the_ Content ' ' bing_paragraph_indentation ' Code class= "PHP Plain"); |
Method Two:
Because different topics may be not the same class and ID, so I do not use the code on the Web instead of myself to add, first press F12 to review the elements, and then navigate to a paragraph of text in the article.
For example, the class that corresponds to my first line here is entry p so I added the following code to the STYLE.CSS:
| 1234 |
/*文章首行缩进*/.entry p { text-indent:2em; /*这里就是设置首行缩进的距离,这个大小可以自行调整*/} |
Save it and succeed.
WordPress article First Line indent