Add copyright information to every post
October 21st, 2010 at 02:56am Jason 84 views
Sometimes we want to show our copyright to the readers, we can add the copyright information under every post, for WordPress users, it’s not difficult, just put some code into functions.php, here is the code below:
<?php /* Plugin Name: copyright information Plugin URI: http://fairyfish.net/m/copyright/ Description: Add copyright information to every post Author: Denis */ function post_copyright(){ if(is_single()){ global $post,$authordata; ?> <div id="copyright"> <?php echo get_avatar($authordata->ID,'55');?> <p>Author: <a href="<?php echo $authordata->user_url; ?>" title="<?php echo $authordata->display_name;?>"><?php echo $authordata->display_name;?></a><br /> Via: <a href="<?php echo get_permalink($post->ID);?>" title="<?php echo $post->post_title; ?>"><?php echo $post->post_title; ?></a><br /> Copyright <a href="<?php bloginfo('url');?>" title="<?php bloginfo('name');?>"><?php bloginfo('name');?></a> All rights reserved.</p> </div> <?php } } add_filter('the_content','post_copyright_content'); function post_copyright_content($text){ ob_start(); post_copyright(); $post_copyright_content = ob_get_contents(); ob_end_clean(); return $text.$post_copyright_content; } ?>
If you want to get the author information, you can use the code below:
<?php the_author_description(); ?>
Entry Filed under: WordPress Tagged with: blog code copyright PHP wordpress
Hot Posts Hot Comments Hot Tags
- apartment bbpress blog class CMS code CSS div dream english friends girl Google hot Hot Dog html job JS life lines love Madonna menu Michael Jackson movie oral english PHP plugin saying school sexy site student students submenu success tags teacher teaching txt university video website widget wordpress





Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">
Trackback this post | Subscribe to the comments via RSS Feed