Support » Fixing WordPress » Date error / too few arguments

  • On my posts page in each post is coming suddenly the following error message on the place of the date (I guess the problem is with date code):

    on line 218 Warning: sprintf(): Too few arguments in /public_html/wp-content/themes/oxygen/library/functions/shortcodes.php

    and in line 218 is:
    $published = '<abbr class="published" title="' . sprintf( get_the_time( esc_attr__( 'l, F jS, Y, g:i a', 'hybrid-core' ) ) ) . '">' . sprintf( get_the_time( $attr['format'] ) ) . '</abbr>';

    The whole part of that code there is:

    function hybrid_entry_published_shortcode( $attr ) {
    	$attr = shortcode_atts( array( 'before' => '', 'after' => '', 'format' => get_option( 'date_format' ) ), $attr );
    
    	$published = '<abbr class="published" title="' . sprintf( get_the_time( esc_attr__( 'l, F jS, Y, g:i a', 'hybrid-core' ) ) ) . '">' . sprintf( get_the_time( $attr['format'] ) ) . '</abbr>';
    	return $attr['before'] . $published . $attr['after'];
    }

    What I should change there? Thank you for all advices!

  • The topic ‘Date error / too few arguments’ is closed to new replies.