I was trying to turn the email field into a mailto link within the “Shufflehound Contacts” widget, but none of my changes are taking effect.
I followed your instructions from this post: https://support.shufflehound.com/forums/topic/change-widgets/#post-9266
For your reference I attach a screenshot showing the entire path to my customized widget.php within my jevelin-child theme folder.
Can you please help to confirm what is required for widget customization?
I am using WordPress 4.9 and Jevelin theme 2.6.1.
A quick update: I think there is an error in the widget PHP code. To link up the widget.php file, the class-widget-contacts.php builds up $filepath using the get_template_directory() function.
line 23 of the class-widget-contacts.php:
$filepath = get_template_directory() . ‘/inc/widgets/contacts/views/widget.php’;
Based on WordPress documentation get_template_directory() will provide path to the main theme’s folder even if a child theme is used.
Relying on the get_stylesheet_directory() function instead will correct $filepath and the widget.php that is located within the Child theme will be properly included.
line 23 of the class-widget-contacts.php that works with child theme:
$filepath = get_stylesheet_directory() . ‘/inc/widgets/contacts/views/widget.php’;
Wordpress documentation reference:
I hope you are well today and thanks for posting here.
You are customising it correctly but we can’t use get_stylesheet_directory function in place of get_template_directory function as it always returns path of current theme and if child theme is used then child theme path is always returned which causes problem if the user is not overwriting widget in the child theme.
Please advise if you have more questions.