Plugin Author
Jeff K
(@kreitje)
Hey Kev,
Add the following to your themes functions.php file. If you go to Appearance -> Editor, on the right hand side you should see a “Theme Functions” link which will allow you to edit the file.
function hms_testimonials_date( $value ) {
return 'Testimonial Date : ' . $value;
}
function hms_testimonials_source( $value ) {
return 'Client Name : '. $value;
}
function hms_testimonials_testimonial( $value ) {
return 'Testimonial : '. $value;
}
function hms_testimonials_tags( $value ) {
return 'Tags : '. $value;
}
add_filter('hms_testimonials_system_date', 'hms_testimonials_date');
add_filter('hms_testimonials_system_source', 'hms_testimonials_source');
add_filter('hms_testimonials_system_testimonial', 'hms_testimonials_testimonial');
add_filter('hms_testimonials_cf_tags', 'hms_testimonials_tags');
Jeff
Hi Jeff
Many thanks for that, I have added the code and the Field Names now appear.
Question now is how do I control the formatting of the testimonial, for example, can I have the Field Names in Bold ?
I see in the documentation section of the Plugin that there are some CSS Classes, do I use these and if so how do I use them ?
Kev
Plugin Author
Jeff K
(@kreitje)
Hey Kev,
The plugin wasn’t really setup to add field names. I just so happened to create filters that allowed the code I posted to work.
You can do 1 of to things, both of which modify the code I posted.
1. Add strong tags around the field names.
Ex.
function hms_testimonials_date( $value ) {
return '<strong>Testimonial Date :</strong> ' . $value;
}
2. Add a span and use CSS to modify the style to each one.
Ex.
function hms_testimonials_date( $value ) {
return '<span class="hms-testimonial-label">Testimonial Date :</span> ' . $value;
}
Then in your themes style.css add:
.hms-testimonial-label { font-weight: bold; }
Either one will work. The second gives you more flexibility for the future.
Jeff
Hi Jeff
Many thanks, that’s a great help, I will give it a go.
Thanks for your help and writing a great plugin
Kev