Tagged: functions.php, masonry, taxonomy
-
AuthorPosts
-
May 8, 2020 at 3:45 am #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: ";
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, 6 months ago by milkytech. Reason: clarified title
May 8, 2020 at 7:49 pm #1211160Hey milkytech,
You can copy the file to the child theme preserving the folder structure and make your changes there.
Best regards,
VictoriaMay 8, 2020 at 9:07 pm #1211208That 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?
May 12, 2020 at 3:13 pm #1212196Hi,
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,
IsmaelMay 12, 2020 at 6:22 pm #1212295Still 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.
May 13, 2020 at 2:19 pm #1212623Hi,
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,
YigitMay 13, 2020 at 4:04 pm #1212648I’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.
May 13, 2020 at 5:02 pm #1212660I set up ftp for you with the same credentials
May 13, 2020 at 6:31 pm #1212683Hi,
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,
YigitMay 13, 2020 at 6:45 pm #1212694My 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, 6 months ago by milkytech.
May 13, 2020 at 8:19 pm #1212744 -
AuthorPosts
- The topic ‘Customize Masonry taxonomy menu – av-helper-masonry.php – using functions.php’ is closed to new replies.