I have created some pages (not post) in wordpress related to my college notes.
I would like to display a copyright message of the college on this pages, but I don’t want do this manually every time.
So is there any plug-in or tweak available to achieve this?
You could add a custom field to the pages you want to show the copyright on and have your page.php (or header.php or index.php or whatever) look for it.
Example:
Set a custom field of “show_copyright” to “1” in the page editor.
In your page.php, right above
<?php endwhile; endif; ?>
, add this:Now, that said, there’s another way you could do it. Make a copy of your page.php, index,php, whatever, to a new name like “copyright.php”. Add your copyright message into that, and at the very top of the file, add this:
Then, when editing your page, change the Page Template on the right to “Copyright Notice”. The trouble with this second method, though, is if you decide to change something in your website, you’ll need to edit both your page.php file (or index, blah blah) as well as your copyright.php.
Two more methods both without editing any theme files (well, almost).
Method One – the_content filter
similar to before, after you add this to your functions.php
on any page you would like to display the copyrights then just set a custom field of “show_copyright” to “1” in the page editor.
Done!
Method Two – custom shortcode
after adding this code to your functions.php file on any page or post you want the copyright notice to show just add
[MY_COPY]
inside the editor and Done!