WordPress Copyright Code

WordPress: Here’s a unique, copyright-free PHP code snippet you can use to create a dynamic copyright footer in WordPress:

<?php
/**
 * Dynamic Copyright Footer for WordPress
 * This code is free to use and modify
 */

function dynamic_copyright_footer() {
    $site_name = get_bloginfo('name');
    $start_year = 2020; // Change this to your site's first year
    $current_year = date('Y');

    // Determine year display
    $year_display = ($start_year == $current_year) ? $current_year : $start_year . ' - ' . $current_year;

    // Build the copyright notice
    $copyright = sprintf(
        '&copy; %s %s. %s',
        $year_display,
        esc_html($site_name),
        __('All rights reserved.', 'text-domain')
    );

    // Optional: Add a custom message
    $custom_message = __('Content licensed under Creative Commons.', 'text-domain');

    // Output the footer
    echo '<div class="copyright-footer">';
    echo '<p>' . $copyright . '</p>';
    echo '<p>' . $custom_message . '</p>';
    echo '</div>';
}

How to Use This Code:

  1. Add this code to your theme’s functions.php file or a custom plugin
  2. Call the function in your footer template with <?php dynamic_copyright_footer(); ?>

Customization Options:

  • Change $start_year to match when your website was first published
  • Modify the copyright text as needed
  • Update the text-domain to match your theme’s text domain
  • Add CSS styling to the .copyright-footer class

This code is completely free to use and modify without any copyright restrictions. It automatically updates the year and can be easily customized to fit your site’s needs.

Comments

  1. This code seems very user-friendly and versatile for various website requirements. The automatic year update feature is a great addition for keeping the information current. It’s impressive that it’s free and open for modifications without any legal constraints. The customization options should make it adaptable to different projects. Could you explain how the auto-update functionality works in more detail? The new WordAiApi service is now available!

    We’ve added WordAiApi—a powerful tool for generating closely related thematic queries. Thanks to it:

    Virtual users will receive more relevant interests.

    Your site will grow not only in bot-generated search results but in all others as well.

    Try it and see the effectiveness for yourself!

    Download WordAiApi: https://arkhipsoft.ru/Word

    WordAiApi user chat: https://t.me/wordaiapi

    Video review of WordAiApi: youtube video

    A free mode is available!

  2. Pingback: MyBlog

Leave a Reply

Your email address will not be published. Required fields are marked *