WordPress.org

Support

Support » How-To and Troubleshooting » How-To add Twenty Eleven Post Date Images

How-To add Twenty Eleven Post Date Images

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thanks!

    Ok, I followed that tutorial. I have 2 questions:

    A. why the date displayed is always “Jan 01”?

    B. Once fixed point A, how can I change date format from English to Italian?

    OK for point B I modified functions.php as follows

    if ( ! function_exists( 'raindrops_posted_date' ) ) :
    function raindrops_posted_date() {
    ?>
    <h2 class="title-date"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    <?php
    global $post;
    $day = date( 'd',strtotime( esc_html( get_the_date() ) ) );
    $month = date( 'M',strtotime( esc_html( get_the_date() )) );
    
    		switch ($month) {
    		    case 'Jan':
    		        $month = 'Gen';
    		        break;
                    /* and so on ... */
    		}
    
    ?>
    <div class="post-date">
    <span class="post-month"><?php echo $month; ?></span>
    <span class="post-day"><?php echo $day; ?></span>
    </div>
    <?php
    }
    endif;

    but I can’t understand why every post is tagged by January, 1st…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How-To add Twenty Eleven Post Date Images’ is closed to new replies.
Skip to toolbar