/
How do I add the date to the cite
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
, multiple selections available,
Related content
How do I filter the testimonials data before display processing
How do I filter the testimonials data before display processing
More like this
How to change testimonials layout
How to change testimonials layout
More like this
How do I customize my testimonial list and widget output
How do I customize my testimonial list and widget output
More like this
How do you include the actual testimonials for the widget
How do you include the actual testimonials for the widget
More like this
How do I customize my testimonial single output
How do I customize my testimonial single output
More like this
How can I style the shortcode testimonials
How can I style the shortcode testimonials
More like this