Tagged: 

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #579878

    I have directory in my child theme for “includes” and inside I have helper-main-menu.php to make some tweaks there. Works find. I am trying to do the same with helper-social-media.php but it does not look like that file is being recognized. ( I am trying to add some prefix text to the social bookmark links )

    #580021

    Hi thatryan!

    What’s the exact change your trying to do?

    Best regards,
    Elliott

    #580030

    in thmes/child-theme/includes/helper-social-media.php
    in the build_icon() function, around line 82,

    $html  = "";
    $html .= "<".$this->args['inside']." class='".$this->args['class']."_".$icon['social_icon']." av-social-link-".$icon['social_icon']." social_icon_".$this->counter."'>";
    $html .= "<a {$blank} href='".$icon['social_icon_link']."' ".av_icon_string($icon['social_icon'])." title='".ucfirst($icon['social_icon'])."'><span class='avia_hidden_link_text'>".ucfirst($icon['social_icon'])."</span></a>";
    $html .= "</".$this->args['inside'].">";
    
    return $html;

    I am trying to add a span and some text right before the <ul> gets output.

    $html  = "";
     $html .= "<span>Follow Us: </span>";
    
    #580251

    Hey!

    Are you trying to make these changes from Appearance > Editor > functions.php

    If so make sure the folder and file has writable permission set on it as well.

    for more info please check https://codex.wordpress.org/Changing_File_Permissions

    Another alternative is to make changes via FTP and upload the file to server.

    Cheers!
    Vinay Kashyap

    • This reply was modified 8 years, 10 months ago by Vinay.
    #580523

    No I am changing it in my child theme via sFTP.
    Same way I have done everything else, so it is not a permissions issue.

    #581492

    Hey!

    I’m sorry but you can’t override a helper function inside a child theme. The override will only work for template files such as the header.php, loops, templates etc. If you really need to do this in a child theme, copy the whole “avia_social_media_icons” class in the functions.php. Or use javascript / jQuery.

    Best regards,
    Ismael

    #1080721

    Hi Ismael,

    I’m also trying to override a helper php file in my child theme. How can I make sure the file in child the overrides the parent enfold version? I found a post that refers to putting something in functions.php?

    Best regards,
    Matthijs

    #1081283

    Hi,

    You need to copy the whole function or class in the child theme’s functions.php file in order to override the parent function.

    Best regards,
    Ismael

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.