Using the Current Year in Your Posts – WordPress: Do you ever wish you could insert the current year in some of your posts via a simple shortcode?
Add the snippet below to your functions.php file and you’ll be partying like it’s [year]. Obviously we dont use the [year] shortcode on this site because its displaying the shortcode [year] and not the actual current year. :-)
function year_shortcode() { $year = date('Y'); return $year; } add_shortcode('year', 'year_shortcode');
Related Links:
Show Popular Posts Without Plugins
What is a Shortcode in WordPress?
WordPress by the Numbers Facts
How to Update: Automatically create media_buttons for shortcode selection
Should I Choose a Hosted or Non-hosted Blogging Platform?
Create a PayPal Donation Shortcode – WordPress
Redirect New Registered Users to a Specific Page – WordPress
The background-color CSS property
How do I start a WordPress blog? (hosting wordpress)
How do I install plugins in WordPress?
WordPress, SEO, and Social Media Marketing
Introduction to Python Programming Language
Change the Author Permalink Structure – WordPress
Choose your preferred blog CMS platform
Why Python is the cooler programming language
Comparing Python to other languages
Helping humans speak to the computer
The Python Standard Library Ver 3.6.5
Learn more about JavaScript Variables
Learn Code Introspection Python Programming
Learn about programming Loops in Python
Learn Partial functions Python programming
Tips and Tricks for WRITING JAVASCRIPT code
Learn about programming Functions in Python
Learn about Numpy Arrays in Python programming
CODING WITH CSS: The style attribute
Learn about programming Classes and Objects in Python
Introduction to JavaScript – Variables: String Interpolation
Learn List Comprehensions in Python Programming
Methods of teaching programming