How do I create an automated copyright line in WordPress?
June 9, 2016 6:38 AM Subscribe
I'm still a novice at WordPress, and I know next to nothing about PHP, so forgive me if I use the wrong terminology for anything. How do I make a function that displays an author's name and the year to automatically generate a copyright line?
I'm working on a site with content produced by multiple authors. Each author's name is stored as a WordPress category (there's probably a better way to have done this, but it can't be changed now). I'm trying to create a function that will automatically produce the following text string, so that I can insert it into the footer of every post:
Copyright © [YEAR THE POST WAS MADE] [CATEGORY NAME]
Thank you!
I'm working on a site with content produced by multiple authors. Each author's name is stored as a WordPress category (there's probably a better way to have done this, but it can't be changed now). I'm trying to create a function that will automatically produce the following text string, so that I can insert it into the footer of every post:
Copyright © [YEAR THE POST WAS MADE] [CATEGORY NAME]
Thank you!
Best answer: In the loop, use the code
Or if you're really stuck with the category ..
In the loop, use the code
Function reference from Codex -
https://codex.wordpress.org/Function_Reference/the_date
https://codex.wordpress.org/Function_Reference/get_the_author
StackOverflow about the_category - http://stackoverflow.com/questions/945906/how-to-get-the-category-title-in-a-post-in-wordpress
Some tips for multiauthor blogs - http://www.hongkiat.com/blog/35-tips-tricks-to-manage-and-handle-multi-author-blogs/
posted by kellygrape at 6:59 AM on June 9, 2016 [3 favorites]
Copyright © <?php the_date('Y'); ?> <?php echo get_the_author(); ?>
Or if you're really stuck with the category ..
In the loop, use the code
Copyright © <?php the_date('Y'); ?> <?php the_category(', '); ?>
Function reference from Codex -
https://codex.wordpress.org/Function_Reference/the_date
https://codex.wordpress.org/Function_Reference/get_the_author
StackOverflow about the_category - http://stackoverflow.com/questions/945906/how-to-get-the-category-title-in-a-post-in-wordpress
Some tips for multiauthor blogs - http://www.hongkiat.com/blog/35-tips-tricks-to-manage-and-handle-multi-author-blogs/
posted by kellygrape at 6:59 AM on June 9, 2016 [3 favorites]
Don't put a copyright for each post (e.g. in the loop), put it in the footer.php of your theme.
posted by furtive at 1:26 PM on June 9, 2016
posted by furtive at 1:26 PM on June 9, 2016
Response by poster: That did the trick! Thank you, kellygrape!
posted by Faint of Butt at 5:02 PM on June 9, 2016
posted by Faint of Butt at 5:02 PM on June 9, 2016
« Older Awesome gift for 11yo niece in Japan | Where do I take my indecisive mom and her dog on... Newer »
This thread is closed to new comments.
posted by Chocolate Pickle at 6:48 AM on June 9, 2016 [2 favorites]