Home › Forums › Legacy Support › Support queries › How-to & Troubleshooting › Current Year in Copyright Footer
Tagged: copyright, footer, javascript, php
- This topic has 9 replies, 5 voices, and was last updated 6 years, 8 months ago by Diana.
Viewing 10 posts - 1 through 10 (of 10 total)
-
AuthorPosts
-
March 15, 2017 at 6:11 pm #101262mkeenSpectatorHi: I currently hardcoded the Year in WPLMS Footer - Copyright. However, I would like to dynamically display the current year and tried with php code, but it did not work. How do I have the copyright footer display current year automatically? Thanks for the help. Best Regards,
Mike
March 16, 2017 at 1:28 pm #101405H.K. LatiyanParticipantSorry this is not possible. You have to manually change it.April 26, 2017 at 2:49 pm #109018caseyhParticipantI'm interested in doing this, too, on instinctivecognition.com I'd like to use a version of this php code I found here: http://www.wpbeginner.com/wp-tutorials/how-to-add-a-dynamic-copyright-date-in-wordpress-footer/ It instructs to place the following in functions.php:function comicpress_copyright() { global $wpdb; $copyright_dates = $wpdb->get_results(" SELECT YEAR(min(post_date_gmt)) AS firstdate, YEAR(max(post_date_gmt)) AS lastdate FROM $wpdb->posts WHERE post_status = 'publish' "); $output = ''; if($copyright_dates) { $copyright = "© " . $copyright_dates[0]->firstdate; if($copyright_dates[0]->firstdate != $copyright_dates[0]->lastdate) { $copyright .= '-' . $copyright_dates[0]->lastdate; } $output = $copyright; } return $output; }
And then to place this (edited for display) call in footer.php:< ? php echo comicpress_copyright(); ? >
However, when I try that this new copyright notice displays below the theme's footer and looks terrible. Is there some other theme file I could edit to drop in thatcomicpress_copyright()
call so that it displays where it's supposed to? I tried putting this similar JavaScript version, which I've used on other non-Wordpress sites, in the WPLMS options > Footer text editor, but it didn't work. Can I put JavaScript or PHP is the WPLMS options Footer text editor somehow? Or can you point out the theme file I'd need to edit to drop it in?April 27, 2017 at 2:04 pm #109201H.K. LatiyanParticipantIn the wplms 2.8 version releasing within a day or two we are adding a shortcode which will give the current date, year . So after update you can use the shortcode instead.April 27, 2017 at 2:06 pm #109203caseyhParticipantCool. I'll look forward to it. Thank you!April 28, 2017 at 11:22 am #109390H.K. LatiyanParticipantYes, sure.April 6, 2018 at 5:44 am #152402MzPlatinumParticipantHi there, I see the shortcode listed in the 2.8 update log [vibe_current_date] ... the shortcode displays on my site like this: <span style="color: #444444; font-family: Varela; font-size: 14px; text-transform: uppercase;">2018/04/06 </span> How do I customize it so it only shows the year?April 6, 2018 at 6:29 am #152406DianaParticipant@MzPlatinum, Please paste this code in wp-admin > Plugins > editor > Select WPLMS Customizer plugin > wplms-customizer.php add_shortcode('vibe_current_date_with_year','vibe_current_date_with_year'); function vibe_current_date_with_year($atts, $content = null){ extract(shortcode_atts(array( 'format' => 'Y', ), $atts)); $return = date($format); return $return; } Then add a text widget in footer sider and paste this shortcode : [vibe_current_date_with_year] This will display only the current year And Please create your own topic for your own issues.April 6, 2018 at 5:15 pm #152489MzPlatinumParticipantThank you! That worked. I'll open up my own a topics as well.April 7, 2018 at 4:35 am #152509DianaParticipant@MzPlatinum, Thanks for confirmation -
AuthorPosts
Viewing 10 posts - 1 through 10 (of 10 total)
- The topic ‘Current Year in Copyright Footer’ is closed to new replies.