-
AuthorPosts
-
March 4, 2020 at 4:24 pm #1190117
Hi,
Many times I would like to change a file in Enfold am I’m searching the forum on how to do so. In the end it never works because I don’t understand what to do, or what I do doens’t work. I am hoping you can help me out.
In this specific case I want to edit the file /enfold/config-templatebuilder/avia-shortcodes/timeline/timeline.php. There is something wrapped in
<strong>
that I want to remove on line 1313. What I want is to copy the file to my child theme, make sure that this file is loaded instead of the Enfold file (this is where I get stuck) and make changes to this file.Can you please help me with this specific solution but more important, with a better understanding of when and which files I can edit and what is the correct way to do so? My aim is also to lower the amount of questions on the forum.
Thanks so much,
Daniel- This topic was modified 4 years, 9 months ago by Daniel.
March 7, 2020 at 1:06 pm #1191101Hey Daniel,
Sorry for the late reply, in this specific case we will add a directory to our child theme /shortcodes/ and then we will copy the “timeline” directory to it. Then we will add this code to the child theme functions.php:function avia_include_shortcode_template( $paths ) { if( ! is_array( $paths ) ) { $paths = array(); } $template_url = get_stylesheet_directory(); array_unshift( $paths, $template_url . '/shortcodes/' ); return $paths; } add_filter( 'avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1 );
If you are using the newest child theme included with v4.7.3 then this code is already included.
Now we will edit our “timeline.php” to suit, so the “strong” wrap only shows once in timeline.php in the latest version, on lines 1397-1398, which wraps the timeline date with “strong”, I removed it as a test.
Then we refresh the page and the “strong” has been removed.
That is all there is to it.Best regards,
MikeMarch 7, 2020 at 1:22 pm #1191103Hi Mike – what do you mean by:
If you are using the newest child theme included with v4.7.3 then this code is already included
The child theme i can download has no entry in the child-theme functions.php and in 4.7.3 i can not find an analog loading –
so I think it’s still necessary to activate it with the snippet from above.And may i ask for what the if clause is here in your code – i allways use this without:
function avia_include_shortcode_template($paths){ $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; } add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1);
March 7, 2020 at 9:47 pm #1191169Hi,
Odd, the version 4.7.3 that I received included a child theme with the above code in the functions.php, perhaps it’s a beta version, I thought it was added to everyone’s version. My mistake.Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.