WordPress.org

Ready to get started?Download WordPress

Forums

Matala Theme - Don't react on specifying date format (7 posts)

  1. candybutterfly
    Member
    Posted 2 years ago #

    Hi there!
    I'm using Matala theme for my blog. The trouble is that on the corner with post date I still may see just a code specifying the date format.
    Here how it looks -> http://artforjoy.com/date-corner.png

    The strangest part of it is that if I change the code in any part of functions.php from unspecified get_the_time() to get_the_time( 'M' ) it shows me that M or anything I write there!
    But if keep it empty no matter get_the_time() or get_the_date() it shows full date or month whatever.

    Can anybody help me, please? =3

  2. curtismchale
    Member
    Posted 2 years ago #

    You should be using just the_time. get_the_time is meant to return the time for PHP to do something with it while the_time is supposed to display the time. I suppose you could just echo get_the_time but that's not the right way to do it.

  3. candybutterfly
    Member
    Posted 2 years ago #

    Nope. It doesn't show anything at all -> http://artforjoy.com/date-corner-2.png

    Here is the original code. Maybe it may help to help me.

    if ( ! function_exists( 'matala_post_date' ) ) :
    /**
     * Prints HTML with meta information for the fancy display of the current post's month and day
     */
    function matala_post_date() {
    	printf( __( '<div class="post-date"><span class="entry-month">%1$s</span><span class="entry-day">%2$s</span></div>', 'matala' ),
    		esc_attr( get_the_time( 'M' ) ),
    		esc_attr( get_the_time( 'j' ) )
    	);
    }
    endif;
  4. candybutterfly
    Member
    Posted 2 years ago #

    Let me explain again.
    Here is the original code:

    esc_attr( get_the_time( 'M' ) ),
    		esc_attr( get_the_time( 'j' ) )

    And a result of one -> http://artforjoy.com/date-corner.png
    We can see M and J in the corner on place where Month and Day should be.

    If I do not specify what I want to see, like this:

    esc_attr( get_the_time() ),
    		esc_attr( get_the_time() )

    Everything works as we wrote, here is the result -> http://artforjoy.com/date-corner-3.png

    If I change tags to the_time, like this:

    esc_attr( the_time() ),
    		esc_attr( the_time() )

    I get empty space -> http://artforjoy.com/date-corner-2.png

    What is not right in that code? Why it doesn't react when I specify the date format?
    What should I do to make it show me the month and the day as it shown in theme preview? -> http://wp-themes.com/matala/?TB_iframe=true&width=1760&height=1166
    Please, help me anyone... < . >

  5. candybutterfly
    Member
    Posted 2 years ago #

    People... =(

  6. jsmim
    Member
    Posted 2 years ago #

    This is my code I had to solve the same problem.

    In Matala theme the functions.php file
    Lines from 299 to 301

    esc_attr( get_the_date( 'j F, Y') ),
    		esc_attr( get_the_date( 'j F, Y') ),
    		esc_html( get_the_date( 'j F, Y') ),

    and
    for the comments

    /* translators: 1: comment author, 2: date and time */
    						printf( __( '%1$s %2$s <span class="says">said:</span>', 'matala' ),
    							sprintf( '<span class="fn">%s</span>', get_comment_author_link() ),
    							sprintf( '<a href="%1$s"><time pubdate datetime="%2$s">%3$s</time></a>',
    								esc_url( get_comment_link( $comment->comment_ID ) ),
    								get_comment_time( 'g:ia' ),
    								/* translators: 1: date, 2: time */
    								sprintf( __( '%1$s %2$s', 'matala' ),  get_comment_date( 'F j, Y' ) ,  get_comment_time( 'g:ia' )  )
  7. jsmim
    Member
    Posted 2 years ago #

    ... and in qTranslate in advanced settings I have

    Conversión de Fecha / Tiempo Utilizar función de fecha emulada.
    In english something like:
    Conversion of Date / Time Use emulated date function

Topic Closed

This topic has been closed to new replies.

About this Topic