Site logo

Archived topic

Problems when I add php code with Snippets

1 reply · Started by yan on May 14, 2019

Viewing posts 1–2 of 2

Hi,

I want to add copyrights information to every post.

So I add a filter via the Snippets plugin and the code is:
-----------------
function add_copyright_to_post($content){
if(is_single() or is_feed()) {
$content .= "some copyrights words";
return $content;
}
}
add_filter('the_content', 'add_copyright_to_post');
-----------------
Then the "some copyrights words" are displayed at the bottom of every post single page.
But I got a display problems at the index page.
The entry-content and read-more-container are disappeared!!!

Please help me to solve this problem.

Thank you very much.

This archived topic is closed to new replies.