wordpress releated post

Automatically Update Copyright Year

To show dynamic year on the website we can follow the following steps: Simple: Date range: Next method For the functions.php file: function year_shortcode() { $year = date(‘Y’); return $year; } add_shortcode(‘year’, ‘year_shortcode’); Usage Use [year] in your posts. Source : https://kerstinmartin.com/blog/copyright-noticehttps://css-tricks.com/snippets/wordpress/year-shortcode/

Category Specific Single Post Templates

Sometimes we may required different category related single post template , i get the following things . First put the code in function.php Then create file as single-categoryname.php. Now the custom template will load while loading the page related to the categoryname.