How do I add the date to the cite
Step-by-step guide
You can use the filter `testimonials_widget_cite_html` to add the testimonial date to the cite.
You can add the following sample code to your theme's `functions.php` file to do so, only on a particular page. Do note that the code like `16507 != get_the_ID` is meant to prevent this function from running on that page. Don't blatantly copy and paste expecting things to work if you don't understand the code.
add_filter( 'testimonials_widget_cite_html', 'my_testimonials_widget_cite_html', 10, 3 ); function my_testimonials_widget_cite_html( $cite, $testimonial, $atts ) { if ( 16507 != get_the_ID() ) return $cite; $post = get_post( $testimonial['post_id'] ); $the_date = mysql2date( get_option('date_format'), $post->post_date ); if ( ! empty( $the_date ) ) $cite .= ' - ' . $the_date; return $cite; }
This requires Testimonials Widget 2.12.8 or newer.
Related articles