Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].
Hi! I’am trying to replace basic sow-testimonials widget themplate by this gide – Template file filter, but nothing work, what i do wrong?
this code i put into functions.php in child theme:
function mytheme_testimonials_template_file( $filename, $instance, $widget ){ if( !empty($instance['design']['theme']) && $instance['design']['theme'] == 'test' ) { // This option works for plugins $filename = plugin_dir_path( __FILE__ ) . 'tpl/default.php'; // And this one for themes $filename = get_stylesheet_directory() . '/tpl/1.php'; // this modify copy of original default.php in widget dirrectory } return $filename; } add_filter( 'siteorigin_widgets_template_file_sow-testimonials', 'mytheme_testimonials_template_file', 10, 3 );
Hi Constantin,
The provided code requires that the test Testimonials theme is being used. Can you please send me the code you’re using where you added that theme?
If you haven’t done that yet, this is possible by modifying the form.
Alex, thanks a lot! I missing this part, but now this works fine! This is how i am modified button example to use width testimonials widget:
Now i can choose my own template in widget front-end editor!