Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I modified this code from the Twenty Eleven theme but it doesn't work and I cant see why.

if ( ! function_exists( 'theme_post_meta_data' ) ) :
/**
 * This function prints post meta data.
 *
 * Adopted from Twenty Eleven
 */
function theme_post_meta_data() {
    printf( __( '%1$sPosted on %2$s by %3$s', 'theme' ),
        esc_attr( '<span class="posted">'),
        sprintf( '</span><a href="%1$s" title="%2$s" rel="bookmark"><span class="timestamp" "%3$s">%4$s</span></a><span class="byline">',           
            esc_url( get_permalink() ),
            esc_attr( get_the_time() ),
            esc_attr( get_the_date( 'c' ) ),
            esc_attr( get_the_date() ),
        ),
        esc_attr( sprintf('<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span></span>' ,
            esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
            esc_attr( sprintf( __( 'View all posts by %s', 'theme' ), get_the_author() ) ),
            get_the_author() , ),
        ),
    );
}
endif;

I get a HTTP Error 500.

Thanks

share|improve this question
    
What exactly doesn't work? Please add a proper problem/error description. –  kaiser Sep 23 '12 at 23:18
    
@kaiser I get a HTTP error 500 –  grappler Sep 24 '12 at 19:30
    
Close voting as "too localized" - see answer. –  kaiser Sep 27 '12 at 21:24
    
Have you checked you error logs? –  Brian Fegter Sep 28 '12 at 12:27
add comment

closed as too localized by kaiser, Wyck, Rarst Sep 28 '12 at 19:02

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers

up vote 1 down vote accepted

I solved the problem by using this code.

if ( ! function_exists( 'theme_post_meta_data' ) ) :
/**
* This function prints post meta data.
*/
function theme_post_meta_data() {
printf( __( '<span class="%1$s">Posted on </span>%2$s<span class="%3$s"> by </span>%4$s', 'theme' ),
'meta-prep meta-prep-author posted', 
sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="timestamp">%3$s</span></a>',
    get_permalink(),
    esc_attr( get_the_time() ),
    get_the_date()
),
'byline',
sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
    get_author_posts_url( get_the_author_meta( 'ID' ) ),
    sprintf( esc_attr__( 'View all posts by %s', 'theme' ), get_the_author() ),
    get_the_author()
    )
);
}
endif;
share|improve this answer
    
What exactly is different? –  kaiser Sep 24 '12 at 22:11
    
@kaiser There are small things like removing the esc_url() and then including the span in the string so that the class can be moved with the text for languages where the order is not the same. –  grappler Sep 27 '12 at 20:57
    
+1 for showing your solution. Not too common upon 1 rep users :) –  kaiser Sep 27 '12 at 21:24
add comment

you spelled your function wrong. You have thme_post_meta_data() instead of theme_post_meta_data. Therefore, you function does not exist

share|improve this answer
    
I doesn't work even with that correction. I have corrected it in my question. –  grappler Sep 24 '12 at 5:19
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.