WordPress articles are automatically added at the bottom of the copyright notice and links

Now write a blog is not easy, but also copied or reproduced, so many bloggers at the bottom of the article will add copyright notice and links. Hope that some respect for the copyright of the Internet people can be reproduced in the time to leave a link and source. But if each article is manually added, then it will be very troublesome, and WordPress blog can be easily achieved automatically add copyright notice and links.
The original Liboseo is used directly in the article template in the article below to add the code, I use the WordPress official twentyten theme modified, so edit the theme of the loop-single.php, find the following code:
<div class = “entry-content”>
<? php the_content ();?>
<? php wp_link_pages (array (‘before’ => ‘<div class = “page-link”>’. __ (‘Pages:’, ‘twentyten’), ‘after’ => ‘</ div>’)) ;
</ div> <! – .entry-content ->
in
<? php the_content ();?>
Followed by the following code:
<copy> please specify from <a href=’http://www.cmsjzy.cn’> CMS concentration camp </a>, this article address: <a href=<?php the_permalink();;> ‘title = ‘<? php the_title ();?>’> <? php the_permalink ();?> </a>
Unless noted, CMS concentration camp articles are original, reproduced, please indicate the source and link! </ pre>
But out of the question, that is, if you install some wumii or Baidu share like plug-ins, then add the contents of the above can only be found in the absence of the following, rather than close to the article. Obviously this is not the effect we want.
After a variety of tests, and finally through the theme of the custom function to solve.
The method is very simple, because the reason we add the content can not be close to the article, because these plugins will be inserted into the contents of the_content (); function, and this function is WordPress program default function. If we modify the_content () function directly, then if you upgrade the WordPress program, it will be overwritten.
So I am through the theme of the functions.php file, in the bottom to add a custom function liboseo_content (), as follows:
function liboseo_content ($ more_link_text = null, $ stripteaser = 0) {
$ content = get_the_content ($ more_link_text, $ stripteaser);
$ content. = “<pre> reprint please specify from <a href=’http://www.cmsjzy.cn’> CMS concentration camp </a>,”;
$ content. = “URL: <a href='”.get_permalink($post, true).”‘ title='”.get_the_title($post_id).”‘>” .get_permalink ($ post, true). </a> “;
$ content. = “\ n unless noted, CMS concentration camp articles are original, reproduced please specify the source and link! </ pre>”;
$ content = apply_filters (‘the_content’, $ content);
$ content = str_replace (‘]]’, ‘]] & gt;’, $ content);
echo $ content;
And then the theme of the article template in the_content (); replaced with a custom function, such as my theme template file is loop-single.php, directly on the_content (); modified to liboseo_content (); into The
<div class = “entry-content”>
<? php liboseo_content ();?>
<? php wp_link_pages (array (‘before’ => ‘<div class = “page-link”>’. __ (‘Pages:’, ‘twentyten’), ‘after’ => ‘</ div>’)) ;
</ div> <! – .entry-content ->
To keep a look at it, is it a success? Before the change must be back up the original file, if possible, it is best to test the local good, and then modify the site.