Facebook Twitter Instagram
    Trending
    • The Ultimate Roadmap to Master Javascript
    • The Complete Guide to Batteries : Evolution, Working & Types
    • The Ultimate Transformation of Global Cellphone Market
    • The Ultimate Crisis Mitigation Strategies in Supermarkets
    • The Safety, Quality & Legal Compliance in Retail Operations
    • The Ultimate Guide to 90 Blockchain Terms and Concepts
    • The Ultimate Guide to Retail Store Design
    • Smart Carpets Unraveled: A Look into the Software Magic
    Facebook Twitter LinkedIn Pinterest RSS
    Retail MarTech AI
    Leaderboard Ad
    • Home
      • About Us – Aggregators & Classifiers
      • Contact Us
      • Editor’s Picks
      • Jobs
      • Internship
      • Write for Us
    • Topics
      • Failure Stories
        • Startup Failure Stories
        • Business Failure Stories
        • Strategy Failure Stories
        • Marketing Failure Stories
        • Product Failure Stories
        • Rise and Fall Stories
      • Startups
        • Idea Pitch
        • Startup Fund Raising
        • Startup Success Stories
      • Energy
        • Energy Crisis
        • Recycling
        • Waste
        • Renewable
        • Solar Power
        • Solar Vehicles
        • Wind Power
        • Wind Turbine
        • Electric Power
        • Electric Vehicles
        • HydroPower
      • Engineering
      • FIRE Stories
      • Organization
        • Outsourcing
        • Management
        • Organizational Behavior
        • Human Resources
      • Economy
        • GDP
        • World Economy
        • Inflation
        • Recession
        • Financial Markets
        • Commodity
        • Demand and Supply
        • Globalization
      • Theorems
      • Sustainable Living
      • Airlines
      • Water
      • Agriculture
      • Railway
      • Automotive
      • Media
      • Trends
        • Top Industry Trends
        • Top Trends in Media
        • Top Technology Trends
        • Emerging Fields
      • Visa
        • Immigration
        • USA
        • H1B Visa
        • Canada
        • Austria
        • Estonia
        • India
        • Singapore
    • Learn
      • Languages
        • Learn German
          • German Dialogue
          • Day to Day German
          • Email Writing
          • German Stories
          • German Grammar
          • German Nouns
          • Cases and Articles
          • German Tenses
          • German Verbs
          • German Adjectives
          • German Pronouns
        • Learn French
      • Roadmaps
      • How To Create
        • WordPress Website
        • Online Payment Link
        • Online Teaching Videos
      • Learn Programming
        • Frontend
          • Web Development
          • Mobile App Development
            • Flutter
            • MongoDB
        • Backend
          • Web Development
          • Mobile App Development
      • Full Stack Development
      • Data Science Online
        • Statistics Online
        • Python
        • R Programming
        • SAS
        • Marketing Analytics
        • Big Data Online
          • Hadoop
          • MapReduce
          • Apache Pig
          • Apache Hive
          • Apache Spark
      • Work Life Balance
      • How it is Made
      • How Things Work
      • DIY (Do It Yourself)
      • IQ Test
    • Retail
      • History of Retailers
      • Success Stories
      • Failure Stories
      • Retailers
        • Supermarkets
        • Grocery Stores
        • Brick and Mortar
      • Retail Technology
        • AI Retail
        • IOT Retail
        • AR Retail
        • Big Data Retail
        • Blockchain Retail
      • Retail Marketing
        • Retail Marketing Strategy Guides
        • In-Store Marketing
        • Out of Store Marketing
        • Digital Marketing
      • Stationery
      • Retail Management
        • Store Design
        • Top Retail Ads
      • Omnichannel Retail
      • Supply Chain
        • Supply Chain Guides
        • Warehouse
        • Procurement
        • Logistics
        • Manufacturing
        • Supply Chain Crisis
      • Retail Shipping
      • E-Commerce
      • Shopping
      • Fashion
    • Marketing
      • Brand
      • Pricing
        • Pricing Strategy
        • Pricing Analytics
        • Price Optimization
        • Price Elasticity
      • Marketing Mix
      • Customer
        • Customer Service
        • Customer Experience
        • Customer Lifetime Value
        • Customer Acquisition
        • Customer Retention
        • Customer Journey
        • Customer Engagement
      • Marketing Technology
        • Digital Transformation
        • Digital Marketing
          • Website Marketing
          • Email Marketing
          • SMS Marketing
          • Social Media Marketing
          • Search Engine Optimization
        • Customer Tools
        • Digital Attribution
      • Advertising
      • Promotion
      • Marketing Strategy
      • Mobile Marketing
      • Neuromarketing
    • Technology
      • Internet
      • Telecom
      • Information Technology
      • Tutorials
      • Customer Data Platform
      • Artificial Intelligence
        • ChatGPT
        • Robotics
        • Internet of Things (IOT)
        • Self Driving Cars
      • Blockchain
        • Web3
        • Crypto
        • Metaverse
        • Dapps
        • Blockchain Guides
      • Analytics
      • Big Data
      • Tech Videos
      • Tech Failures
      • 3D Printing
        • 3DP Guides
        • 3DP Slicer
        • 3DP Tuning
        • 3DP Processes
        • 3DP Applications
      • Battery
      • Smart Cities
        • Green Places
        • Smart Grid
        • Smart Energy
        • Smart Mobility
        • Smart Home
      • Databases
      • Operating Systems
    • Education
      • Schools and Universities
      • Aptitude Tests
        • Learning Guides
        • Mensa IQ Tests
        • Abstract Reasoning
        • Logical Reasoning
        • Diagrammatic Reasoning
        • Spatial Reasoning
        • Raven’s Progressive Matrices
        • Puzzles
      • Kids Learning
      • Free Online Learning
      • Exams and Tests
        • TOEFL
        • SAT
        • LSAT
        • GMAT
        • CAT
      • Interview Questions
      • Education Technology
    • Business
      • Learning Videos
      • So Expensive
      • Do What You Love
      • Finance
      • Entrepreneurship
      • Innovation
      • Rags to Riches Stories
      • Success Stories
      • Venture Capital
      • Leaders’ Talks
      • Silicon Valley
      • Business Model
    Retail MarTech AI
    You are at:Home » How to Add Copyright & Current Year in the Website Footer
    Image for Shortcode Function
    Shortcode Function for Auto Update of Copyright to the Current Year in the Wordpress Footer

    How to Add Copyright & Current Year in the Website Footer

    0
    By AM on March 22, 2023 Editor's Picks, Wordpress Website

    This Posts Contains Complete Detailed Code to Generates a Shortcode that outputs the copyright notice for a website, including the copyright symbol, the current year, the name of the company, and the “All Rights Reserved” text.

    If you want the text “Copyright © 2023 Company Name. All Rights Reserved.” to be updated to the current year Automatically in your WordPress footer, without any Plugin Installation, the we can Write a function that enables a Shortcode which can then simply be added in your Footer Widget. In this Post we will discuss a Generic Function in Functions.php File that Generates a Shortcode for Copyright © Current Year Company Name. All Rights Reserved. in the Footer Widget in your WordPress Theme.

    How to Add Copyright © Year in the WordPress Footer Widget by Writing a Function

    Function that Allows to Implement Automatic Year Update shortcode in Footer widget

    add_filter(‘widget_text’, ‘do_shortcode’);
    function copyright_shortcode()

    {
    $year = date_i18n(‘Y’); $company_name = ‘<span style=”font-style:normal;color:#F5F5F5;”>Company Name.</span>’; $copyright = ‘<span style=”font-style:normal;color:#F5F5F5;”>Copyright</span>’; $all_rights = ‘<span style=”font-style:normal;color:#F5F5F5;”>All Rights Reserved.</span>’; $year_text = ‘<span style=”font-style:normal;color:#F5F5F5;”>&copy; ‘ . $year . ‘</span>’; return $copyright . ‘ ‘ . ‘<span style=”font-style:normal;color:#F5F5F5;”> &copy; ‘ . $year . ‘ ‘ . $company_name . ‘ ‘ . $all_rights . ‘</span>’;

    }

    add_shortcode(‘copyright’, ‘copyright_shortcode’);

    Code Explanation Step by Step:

    function copyright_shortcode() {

    This line declares a function named copyright_shortcode.

    $year = date_i18n('Y'); This line gets the current year using the WordPress function date_i18n() and assigns it to a variable named $year

    $company_name = ‘<span style=”font-style:normal;color:#F5F5F5;”>Company Name.</span>’;

    This line defines a variable $company_name and assigns it a value of a string, which is wrapped in a span tag with some inline CSS styles. The styles set the font style to normal and the colour to a shade of greyish-white (#F5F5F5). The string itself is “Company Name.” with a period at the end.)

    $copyright = ‘<span style=”font-style:normal;color:#F5F5F5;”>Copyright</span>’;

    This line defines a variable $copyright and assigns it a value of a string, which is wrapped in a span tag with some inline CSS styles. The styles set the font style to normal and the colour to a shade of greyish-white (#F5F5F5). The string itself is “Copyright”.

    $all_rights = ‘<span style=”font-style:normal;color:#F5F5F5;”>All Rights Reserved.</span>’;

    This line defines a variable $all_rights and assigns it a value of a string, which is wrapped in a span tag with some inline CSS styles. The styles set the font style to normal and the color to a shade of greyish-white (#F5F5F5). The string itself is “All Rights Reserved.” with a period at the end.

    $year_text = ‘<span style=”font-style:normal;color:#F5F5F5;”>&copy; ‘ . $year . ‘</span>’;

    This line defines a variable $year_text and assigns it a value of a string, which is wrapped in a span tag with some inline CSS styles. The styles set the font style to normal and the color to a shade of greyish-white (#F5F5F5). The string itself is an HTML entity for the copyright symbol (&copy;) followed by the current year, which is retrieved using the date_i18n() function.

    return $copyright . ‘ ‘ . ‘<span style=”font-style:normal;color:#F5F5F5;”> &copy; ‘ . $year . ‘ ‘ . $company_name . ‘ ‘ . $all_rights . ‘</span>’;

    • return statement is used to return the final output from the function.$copyright is a string variable that contains the text “Copyright” with some styling.' ' is used to concatenate the strings with a space between them.<span style="font-style:normal;color:#F5F5F5;"> &copy; is an HTML span element that adds some styling and contains the copyright symbol, which is represented by &copy;. $year is a PHP variable that contains the current year, which is fetched using the date_i18n() function.
    • . is used to concatenate the string variables with the HTML element.$company_name is a string variable that contains the company name with some styling. The company name is enclosed within an anchor tag that links to a specific URL. $all_rights is a string variable that contains the text “All Rights Reserved” with some styling.</span> is used to close the opening <span> tag.The final output is enclosed within another <span> tag with some styling.

    Now Finally Go to the Footer Widget of your WordPress Theme and simply add “copyright” in Square Brackets: [copyright]

    Doing this Will Generate the Following as displayed in the Image.

    Copyright Shortcode

    To Write the Company Name in Different Colour and Link it Back to Your Website, Here is the Modified Code :

    add_filter(‘widget_text’, ‘do_shortcode’);
    function copyright_shortcode() {
        $year = date_i18n(‘Y’);
        //$company_name = ‘<span style=”font-style:normal;color:#F5F5F5;”>Company Name.</span>’;
        $company_name = ‘<a href=”https://CompanyWebsiteName./” style=”color: #FFA500; text-decoration:  none;”>Company Name.</a>’;
        $copyright = ‘<span style=”font-style:normal;color:#F5F5F5;”>Copyright</span>’;
        $all_rights = ‘<span style=”font-style:normal;color:#F5F5F5;”>All Rights Reserved.</span>’;
        $year_text = ‘<span style=”font-style:normal;color:#F5F5F5;”>&copy; ‘ . $year . ‘</span>’;
        return $copyright . ‘ ‘ . ‘<span style=”font-style:normal;color:#F5F5F5;”> &copy; ‘ . $year . ‘ ‘ . $company_name . ‘ ‘ . $all_rights . ‘</span>’;
    }
    add_shortcode(‘copyright’, ‘copyright_shortcode’);

    Step-by-step Explanation of the code:

    1. function copyright_shortcode() {: This line declares a function named copyright_shortcode.
    2. $year = date_i18n('Y');: This line gets the current year using the WordPress function date_i18n() and assigns it to a variable named $year.
    3. $company_name = '<a href="https://companywebsitename.com/" style="color: #FFA500; text-decoration: none;">Company Name</a>';: This line sets the value of $company_name to a hyperlink that links to YOUR COMPANY WEBSITE and has a colour of orange (#FFA500) and no text decoration.
    4. $copyright = '<span style="font-style:normal;color:#F5F5F5;">; Copyright</span>';: This line sets the value of $copyright to a span element with a normal font style and a color of greyish white (#F5F5F5), with the copyright symbol (©) followed by the word “COPYRIGHT”.
    5. $all_rights = '<span style="font-style:normal;color:#F5F5F5;">All Rights Reserved</span>';: This line sets the value of $all_rights to a span element with a normal font style and a color of greyish white (#F5F5F5), with the text “All Rights Reserved”.
    6. $year_text = '<span style="font-style:normal;color:#F5F5F5;">&copy; ' . $year . '</span>';: This line sets the value of $year_text to a span element with a normal font style and a color of greyish white (#F5F5F5), with the copyright symbol (©) followed by the current year.
    7. return $copyright . ' ' . $year_text . ' ' . $company_name . '. ' . $all_rights;: This line concatenates the values of $copyright, $year_text, $company_name, and $all_rights, separated by spaces and with a period at the end, and returns the resulting string.
    8. add_shortcode('copyright', 'copyright_shortcode');: This line registers the copyright_shortcode() function as a shortcode with the name “copyright”.

    Overall, the code generates a Shortcode that outputs the copyright notice for a website, including the copyright symbol, the current year, the name of the company, and the “All Rights Reserved” text, with the company name being a hyperlink to a specified website and with all text styled in a greyish white color. The Output looks like below :

    Shortcode for Copyright

    You may also like:

    • Retail Failure Stories
    • Retire Early
    • Do What You Love
    • Rags to Riches Stories
    • Entrepreneurship
    • Retail Success Stories
    • Travel Food Culture
    • Contact Us
    • About Us
    Add Copyright in Footer Add Current Year in Footer
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    AM
    • Website

    AM, The Founder and CEO of RetailMarketingTechnology.com is an Entrepreneur & Business Management Professional with over 20+ Years Experience and Expertise in many industries such as Retail, Brand, Marketing, Technology, Analytics, AI and Data Science. The Industry Experience spans across Retail, FMCG, CPG, Media and Entertainment, Banking and Financial Services, Media & Entertainment, Telecom, Technology, Big Data, AI, E-commerce, Food & Beverages, Hospitality, Travel & Tourism, Education, Outsourcing & Consulting. Currently based in Austria and India

    Related Posts

    How to use Pigeonhole Principle in Solving Various Problems

    The Role of Floating Cities in Addressing Climate Change

    How do Animals Inspire Entrepreneurship for Public Good

    Comments are closed.

    Latest Posts
    August 30, 2023

    The Ultimate Roadmap to Master Javascript

    July 28, 2023

    The Complete Guide to Batteries : Evolution, Working & Types

    July 28, 2023

    The Ultimate Transformation of Global Cellphone Market

    July 19, 2023

    The Ultimate Crisis Mitigation Strategies in Supermarkets

    FIRE Stories
    FIRE Stories
    November 21, 20220 FIRE Stories

    The FIRE Story of a Traveller Who Settled in Mexico

    Updated:November 21, 20221 Min Read

    Learn How Roshida Retired at 39 after Traveling the World for about 6 months, and realising that she didn’t want to go back to work. With Financial Independence, she Retired Early & Settled in Mexico.

    November 21, 2022

    The FIRE Story of a Couple who Saw a Health Crisis

    November 17, 2022

    The Quit 9-5 FIRE Story of a Colorado Couple

    October 28, 2022

    The Ultimate FIRE Story of a Frugal Software Engineer

    October 14, 2022

    The Ultimate FIRE Story of an Internet Entrepreneur

    Copyright © 2023 ReMTech.
    • Home
    • Retail
    • Marketing
    • Technology
    • Education
    • Business

    Type above and press Enter to search. Press Esc to cancel.