Custom Copyright for GeneratePress Users

I had previously created a function to rewrite the copyright line but it was lacking some things. I should note that my work here is with the free version of GeneratePress; the paid version offers a different method for dealing with copyright notices.

By default, GeneratePress uses the site’s name as the copyright holder. Since the site name does not necessarily refer to an entity that could claim copyright, I wanted to change it to my consulting company name. It also omits the “All Rights Reserved” clause, perhaps because–strictly speaking–it is not necessary according to the Berne Convention.

The result of my consultation with Gemini was this:

<?php
add_filter( 'generate_copyright', 'custom_gp_copyright' );

function custom_gp_copyright() {
    // Define the start year and get the current year dynamically
    $start_year = '2026';
    $current_year = date('Y');
    
    // Create the year display: "2025" or "2025 – 2026"
    $date_display = ( $start_year == $current_year ) ? $start_year : "{$start_year}&ndash;{$current_year}";

    ?>
    <span class="copyright">&copy; <?php echo $date_display; ?> Jim McGinness Consulting</span> 
    &bull; All Rights Reserved 
    &bull; Built with <a href="https://generatepress.com" itemprop="url">GeneratePress</a>
    <?php
}

This code is added in the child theme functions.php file and does its magic through the add_filter feature which is supposed to be a smart way for themes to offer customization hooks.

Leave a Comment

WordPress Appliance - Powered by TurnKey Linux