Digital experiences for all disciplines
New Landing › How can we help? › Atelier › Child Theme
New Landing › How can we help? › Atelier › Child Theme
- This topic has 11 replies, 3 voices, and was last updated 7 years by David Martin – Support.
-
Posted in: Atelier
-
December 1, 2016 at 11:57 pm #304835
Hi!
I’m trying to set a child theme. I previously worked over the parent child but trying now to work with child theme as there are some pages I’ve edited and want to keep my theme up to date.
I’ve copied the atelier-child folder into the server. Copied the parent pages that were edited into the child theme and updated the parent theme.
I see my modifications are lost. Like the child theme pages are not overriding the parent theme’s pages.
Is there something else I should check?
sorry I’m very new to the child themes.
Regards and thanks a lot.
CorinaDecember 2, 2016 at 7:22 pm #304993Corina what do you mean “parent pages”. Please be specific to what files you are wanting/trying to modify.
Within the child theme for Atelier you would rarely need to copy over template files, unless it’s WooCommerce related. Mostly you would override parent theme PHP functions using functions/actions within the child theme
functions.php
file.December 5, 2016 at 12:38 pm #305118Hi David,
I’m sorry I didn’t explain myself well. I have edited some of the php pages for some customizations needed. Some of these are:
sf-page-heading.php
sf-theme-overrides.php
sf-woocommerce.php
sf-combined.min.css
header-3.phpAnd some functions on:
functions.min.js
functions.phpIt’s little stuff but enough for the template to work as needed for the client.
So know what I want is to try and work with a child theme so I can update easily and not have these edits overwritten. As I understand just putting these files into the child theme should be enough, of course I could be mistaken. I’ve tried setting it but I can’t make it work.
Thanks for your help. Regards,
Corina
December 5, 2016 at 12:57 pm #305124HI Corina,
Those are not template files. Those PHP file contain PHP functions that are hooked into the theme templates via WordPress actions.
Within the files you need to find what PHP function you have modified, then you copy/paste the specific PHP function into the child theme
functions.php
.The CSS/JS files are core theme files and should not be edited. To make new CSS changes, you can override styles by adding your CSS to the child theme
style.css
file or by adding it to Theme Options => Custom CSS.To make new JS you would need to create and enqueue a new JS file or add your jQuery to Theme Options => Custom JS.
December 5, 2016 at 1:08 pm #305128Great David, thank you very much. I’ll give it a try and let you know.
Regards,
Corina
December 5, 2016 at 1:09 pm #305129Glad to help you out.
February 21, 2017 at 3:50 pm #314605Hello,
I got the same issue but cannot resolve it.
I would like update a function in sf-theme-overrides.php.
I tried this in my function.phpremove_filter(‘sf_add_to_wishlist_icon’, ‘sf_atelier_add_to_wishlist_icon’);
function hk_atelier_add_to_wishlist_icon() {
return ‘<i class=”sf-icon-wishlist”></i><span>Ajouter à la liste</span>’;
}
add_filter(‘sf_add_to_wishlist_icon’, ‘hk_atelier_add_to_wishlist_icon’);But it’s not working, also if I just copy past the function from original file (and do not update the name), I got this message:
Fatal error: Cannot redeclare sf_atelier_add_to_wishlist_icon() (previously declared in /home/byluxema/staging/2/wp-content/themes/byluxemarket/functions.php:162) in /home/byluxema/staging/2/wp-content/themes/atelier/includes/overrides/sf-theme-overrides.php on line 122Please help
February 21, 2017 at 4:12 pm #3146081) You should not need to remove the filter first.
2) Will need your FTP details to see this.
February 21, 2017 at 4:15 pm #314613This reply has been marked as private.February 23, 2017 at 5:03 pm #314897Please contact your hosting provider and ask for the following:
– Server
– Username
– PasswordI need actual FTP access not web browser.
Please also add your URL/WP login.
February 23, 2017 at 5:18 pm #314903This reply has been marked as private.February 23, 2017 at 5:40 pm #314911The sample code is already within the child theme
functions.php
for your reference. I have updated your code to now work:function hk_atelier_add_to_wishlist_icon() { return '<i class="sf-icon-wishlist"></i><span>Ajouter à la liste</span>'; } add_filter('sf_add_to_wishlist_icon', 'hk_atelier_add_to_wishlist_icon', 100); add_filter('sf_wishlist_icon', 'hk_atelier_add_to_wishlist_icon', 100); add_filter('sf_wishlist_menu_icon', 'hk_atelier_add_to_wishlist_icon', 100);
-
Posted in: Atelier
You must be logged in and have valid license to reply to this topic.