WordPress.org

Ready to get started?Download WordPress

Forums

[twenty eleven] post date a mess - function not properly working (6 posts)

  1. urseetaeler
    Member
    Posted 2 years ago #

    Hallo,
    after changing to the twenty eleven theme, quite nice and all features available I could look for, I notice a strange line where the date and the author should be:

    Posted on %A, 15UTCMon, 15 Aug 2011 21:55:34 +0000 %e. %B %Y

    my website is http://www.urseetal.net and this fault is visible already in the first not featured article on the topside.

    I have found the function twentyeleven_posted_on() and I am willing to change that to some more easily understood form without any percent signs. I am waiting for suggestions.

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    possibly caused by some missing or wrong options settings in the qtranslate plugin.

  3. urseetaeler
    Member
    Posted 2 years ago #

    Strange! I have tried to look where the date and time functions are used in 20-11. I wonder whether and where

    if ( ! function_exists( 'twentyeleven_posted_on' ) ) :
    /**
     * Prints HTML with meta information for the current post-date/time and author.
     * Create your own twentyeleven_posted_on to override in a child theme
     *
     * @since Twenty Eleven 1.0
     */
    function twentyeleven_posted_on() {
    	printf( __( '<span class="sep">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'twentyeleven' ),
    		esc_url( get_permalink() ),
    		esc_attr( get_the_time() ),
    		esc_attr( get_the_date( 'c' ) ),
    		esc_html( get_the_date() ),
    		esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    		sprintf( esc_attr__( 'View all posts by %s', 'twentyeleven' ), get_the_author() ),
    		esc_html( get_the_author() )
    	);
    }
    endif;

    (code from functions.php of 20-11)

    uses the settings in Settings->General.

    Bernhard

  4. urseetaeler
    Member
    Posted 2 years ago #

    I was not content with 20-11, thus I changed to emptiness as a theme: That resulted in an improved date (still some persent-P symbol) which I do not understand, and more important for me, in sidebars on single post or article pages.

    now the_date() function returns
    19 Aug 2011, 10:19%P

    Does anyone know where the %P comes from?

    Thanks for answers

    Bernhard

  5. arashst
    Member
    Posted 2 years ago #

    Hi Bernhard,

    I don't know if you've already solved your problem or not, but 'cause I've faced the same problem, I may suggest a solution to you. As alchymyth already suggested, you may want to check the settings of your qTranslate-Plugin. Simply try out different Date-Options in Advanced Settings.
    For me, I've just changed from "emulated-date" to "strftime" and it worked fine.

    And about the '%p' according to PHP-Manual, depend on upper- or lower-case of 'p', it gives you back the 'am/pm' string. Just take a look at PHP-Manual for Functions: Date-Time for 'date' or 'strftime'.

    Cheers,
    A.

  6. urseetaeler
    Member
    Posted 2 years ago #

    I got it. You were both correct, but I didnot find the date / strftime settings. Now I looked in the qtranslate settings and found them. Well, I have settled in the meantime for emptiness as theme. That fits also nicely.

    Thanks a lot!

    Bernhard

Topic Closed

This topic has been closed to new replies.

About this Topic