Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1210876

    I’ve made a small customization to the Masonry taxonomy sort menu to simply add the word “Filter: ” to the beginning of the selectable menu. I did this by modifying the av-helper-masonry.php file on line 269 like this:
    $output .= "<div class='av-sort-by-term {$hide} ' data-av-allowed-sort='{$allowed_terms}' >Filter: &nbsp;&nbsp;";
    I am wondering if there is a “hook” or some way to do this by adding a little code to the functions.php in my child theme instead of editing the main theme file so it doesn’t break with a theme update.

    • This topic was modified 4 years, 7 months ago by milkytech. Reason: clarified title
    #1211160

    Hey milkytech,

    You can copy the file to the child theme preserving the folder structure and make your changes there.

    Best regards,
    Victoria

    #1211208

    That didn’t work. I’ve actually tried this method before when adding a custom icon font and it didn’t work then either. Is there code that needs to be added to the functions.php to make sure this file loads from the child theme?

    #1212196

    Hi,

    Yes, you have to create a new shortcode path or directory in the child theme folder and place the shortcode template or files there. Please check the documentation for more info.

    // https://kriesi.at/documentation/enfold/intro-to-layout-builder/

    Thank you for your patience.

    Best regards,
    Ismael

    #1212295

    Still not working. I’ve added this code to functions.php in the child theme:

    add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1);
    function avia_include_shortcode_template($paths)
    {
      $template_url = get_stylesheet_directory();
          array_unshift($paths, $template_url.'/shortcodes/');
    
      return $paths;
    }

    Then created a folder in my child theme folder called shortcodes, then placed my edited copy of av-helper-masonry.php inside it but it is still using the file from the parent theme.
    Screenshot of folder structure

    #1212623

    Hi,

    I just doubled checked on my local installation and it works fine on my end. Have you cleared cache?
    If you have, could you please post WP admin logins here privately so we can look into it? We might need FTP logins as well :)

    Best regards,
    Yigit

    #1212648

    I’ve purged the cache in WP and cleared the browser cache. Private Content login credentials below. I’ll work on ftp credentials if you need it but I’ve been doing web development as a hobby for many years and know how to create folders and upload files. I use dreamweaver for my website management.

    #1212660

    I set up ftp for you with the same credentials

    #1212683

    Hi,

    Following line was commented out in functions.php file

    add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1);

    I simply removed comments. Please review your website :)

    Best regards,
    Yigit

    #1212694

    My bad. I copied the code from the documentation page and I must have pasted it in front of a couple of comment slashes and didn’t notice it! :-)
    Thats what I get for using the Theme Editor instead of editing my local file and uploading with dreamweaver!

    • This reply was modified 4 years, 7 months ago by milkytech.
    #1212744

    Hi,

    Glad we could help! Let us know if you have any other questions or issues :)

    Best regards,
    Yigit

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Customize Masonry taxonomy menu – av-helper-masonry.php – using functions.php’ is closed to new replies.