Current Year in Copyright Footer

Home Forums Legacy Support Support queries How-to & Troubleshooting Current Year in Copyright Footer

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #101262
    mkeen
    Spectator
    Hi: 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
    #101405
    H.K. Latiyan
    Participant
    Sorry this is not possible. You have to manually change it.
    #109018
    caseyh
    Participant
    I'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 that comicpress_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?
    #109201
    H.K. Latiyan
    Participant
    In 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.
    #109203
    caseyh
    Participant
    Cool. I'll look forward to it. Thank you!
    #109390
    H.K. Latiyan
    Participant
    Yes, sure.
    #152402
    MzPlatinum
    Participant
    Hi 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?
    #152406
    Diana
    Participant
    @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.  
    #152489
    MzPlatinum
    Participant
    Thank you! That worked. I'll open up my own a topics as well.
    #152509
    Diana
    Participant
    @MzPlatinum, Thanks for confirmation
Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Current Year in Copyright Footer’ is closed to new replies.