• Resolved Theresa

    (@theresaippl)


    First: Great theme! I use it for a blog at my job and get a lot of compliments on it.

    Second: Is there a way to add the year to the red data ribbons? I found the date code in the Theme Functions but I’m new to WordPress and can’t quite understand the coding.

    Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Theme Author arthur-gareginyan

    (@arthur-gareginyan)

    Hi, Theresa!
    Thanks for the nice words about my work!

    To do this, in file functions.php, find this code:

    // Red Data Ribbons
    /* Display red ribbons. */
    function anarcho_ribbons() {
        if(get_theme_mod('disable_ribbons') == '0') {
            if ( is_home() || is_category() || is_archive() || is_search() ) {
               printf( '<a href="%1$s">',
                    esc_url( get_permalink() )
               );
            }
            printf( '<div class="date-tab">
                         <span class="month">%1$s</span>
                         <span class="day">%2$s</span>
                     </div><!-- .date-tab -->',
                 esc_attr( get_the_date('F') ),
                 esc_attr( get_the_date('j') )
            );
            if ( is_home() || is_category() || is_archive() || is_search() ) {
               printf( '</a>' ); }
        }
    }
    // END-Red Data Ribbons

    and replace to this:

    // Red Data Ribbons
    /* Display red ribbons. */
    function anarcho_ribbons() {
        if(get_theme_mod('disable_ribbons') == '0') {
            if ( is_home() || is_category() || is_archive() || is_search() ) {
               printf( '<a href="%1$s">',
                    esc_url( get_permalink() )
               );
            }
            printf( '<div class="date-tab">
                         <span class="month">%1$s</span>
                         <span class="day">%2$s</span>
                     </div><!-- .date-tab -->',
                 esc_attr( get_the_date('F j') ),
                 esc_attr( get_the_date('Y') )
            );
            if ( is_home() || is_category() || is_archive() || is_search() ) {
               printf( '</a>' ); }
        }
    }
    // END-Red Data Ribbons

    Thread Starter Theresa

    (@theresaippl)

    Works great! Thanks!

    Theme Author arthur-gareginyan

    (@arthur-gareginyan)

    You are welcome!

    thanks for this!

    Will the option be in future updates, or should I make sure to bookmark this page so I can come back and fix it?

    love the theme!

    Thanks a lot for this! ??

    Theme Author arthur-gareginyan

    (@arthur-gareginyan)

    You are welcome!
    Ok, I will add function for this in to customizer. It will be in version 2.11.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Adding year to data ribbons’ is closed to new replies.