Home / Archive / Dynamic year for inserting copyright using only html with inline js
Duplicate Snippet

Embed Snippet on Your Site

Dynamic year for inserting copyright using only html with inline js

Adjust the styling either inline or using css.
Either automatically add this to your site-wide footer, or use a shortcode to insert it manually.
Optional: add your site title before the copyright text

Code Preview
universal
<!-- Dynamic Copyright Year Block -->
<span id="copyright" class="wp-block-paragraph" style="color: currentcolor; background: transparent; font-size: 0.85em; font-family: 'Times New Roman', serif; letter-spacing: 0.01em; word-spacing: 0.1em;">Copyright © 
	<!-- beginning of copyright script -->
	<script>
		document.write(new Date().getFullYear());
	</script>
	<!-- end of copyright script -->
</span>

Comments

Add a Comment