Home > CMS Tutorial > WordPress > body text

How to manage custom text at the bottom of the page in WordPress

angryTom
Release: 2019-11-09 16:48:36
Original
3204 people have browsed it

How to manage custom text at the bottom of the page in WordPress

1. First find the code that adds custom content to the bottom of all articles

//在所有文章底部添加自定义内容
function add_after_post_content($content) {
if(!is_feed() && !is_home() && is_singular() && is_main_query()) {
$content .= '你需要添加的自定义内容';
}
return $content;
}
add_filter('the_content', 'add_after_post_content');
Copy after login

2. We need to Copy this code to functions.php of WordPress

Enter the WordPress backend, click "Appearance" - "Edit", click "Template" in the right column, click "Theme" Functions (functions.php)" to enter the editing interface of functions.php.

3. Then copy our code in front of "//End All"

At this time you only need to put "custom content you need to add" Just change it to the text content you want.

Remember to click "Update File" after making changes, otherwise all your efforts will be wasted.

Recommended tutorial: WordPress tutorial

The above is the detailed content of How to manage custom text at the bottom of the page in WordPress. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template