Changes to widget file do not take effect

Home Forums Jevelin Theme Changes to widget file do not take effect

Home Forums Jevelin Theme Changes to widget file do not take effect

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • laszlo_oe
    Participant

    Hi,

     

    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.

     

    Thank you.

    Attachments:
    You must be logged in to view attached files.

    laszlo_oe
    Participant

    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:
    https://developer.wordpress.org/reference/functions/get_template_directory/
    https://developer.wordpress.org/reference/functions/get_stylesheet_directory/

    Attachments:
    You must be logged in to view attached files.

    Hi @laszlo_oe,

     

    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.

     

    Best regards,
    Shufflehound team

Viewing 3 posts - 1 through 3 (of 3 total)

Popular choice

Professional Developers At Your Fingertips!

If you need services beyond standard support, we've got your back!

Services we offer:

Demo setup
Advanced customization
Layout adjustment
Graphic work / visualizations
Custom coding
Full WordPress development and design

Services

What we can offer

  • Demo setup +

    If you'd prefer not to handle the installation yourself or need help getting started, we'll set everything up for you.

  • Layout adjustment +

    We'll help you rearrange sections, adjust spacing, and modify the page structure to fit your needs.

  • Advanced customization +

    More complex styling changes, theme option modifications, and third-party integrations.

  • Custom coding +

    If you need something that's not included in the theme, we can code it for you.

  • Graphic work / visualizations +

    Web design services to create custom sections, pages, and blocks for your theme, plus graphics and visualizations.

  • Full WordPress development and design +

    Full website builds, custom theme development, or plugin creation from scratch.

  • About pricing +

    We'll provide a clear quote based on what you need. No hidden fees.

Professional Developers At Your Fingertips!

Custom Work Form