Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › How to use child theme but still edit theme files and not lose changes in Update
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › How to use child theme but still edit theme files and not lose changes in Update
- This topic has 11 replies, 3 voices, and was last updated 9 years by Rui Guerreiro – SUPPORT.
-
Posted in: Neighborhood
-
April 1, 2015 at 7:43 am #162481
Hi
I previously did alot of changes in Neighborhood theme files (without child theme) only to realise with update that all my changes were overwritten.
How do I use the child theme (I already uploaded and activated it) and still edit theme files. In the folder I only see a style CSS, no other files.
Do I still change content in the main theme files and only update the child theme. Sorry for the confusion, i am not sure what to do.
April 1, 2015 at 8:01 am #162488Hi,
Please take files from parent theme and paste at child theme directory. Now edit these files as child theme directory.
Thanks
MohammadApril 1, 2015 at 8:12 am #162492with the same folder structure, or can i just paste directly
April 1, 2015 at 8:20 am #162495Hi,
With the same folder structure.
Thanks
MohammadApril 27, 2015 at 11:04 am #168980I am having issues with the child theme not picking up my php changes. I have uploaded and activated the child theme: neighborhood-child.
Example: I wanted to change the sf_header.php file. So I find the php file here:
/neighborhood/includes/swift-framework/sf-content-display/sf-header.phpI change “Welcome” to “Hello” in line 469
Then I upload the new sf-header.php to the child theme here:
/neighborhood-child/includes/swift-framework/sf-content-display/sf-header.phpThe change does not work. What am I doing wrong?
April 27, 2015 at 11:15 am #168985Hi,
That file would require to add a lot more files.
Do it like this.copy your entire changed function to the functions.php of the child theme. It will work fine.
if (!function_exists('sf_woo_links')) { function sf_woo_links($position, $config = "") { // VARIABLES $options = get_option('sf_neighborhood_options'); $tb_search_text = $options['tb_search_text']; $woo_links_output = $ss_enable = ""; if (isset($options['ss_enable'])) { $ss_enable = $options['ss_enable']; } else { $ss_enable = true; } // WOO LINKS OUTPUT $woo_links_output .= '<nav class="std-menu '.$position.'">'. "\n"; $woo_links_output .= '<ul class="menu">'. "\n"; if ( sf_woocommerce_activated() ) { if (is_user_logged_in()) { global $current_user; get_currentuserinfo(); $woo_links_output .= '<li class="tb-welcome">' . __("Hello", "swiftframework") . " " . $current_user->display_name . '</li>'. "\n"; } else { $woo_links_output .= '<li class="tb-welcome">' . __("Hello", "swiftframework") . '</li>'. "\n"; } } if ($ss_enable) { if ($position == "top-menu") { $woo_links_output .= '<li class="tb-woo-custom clearfix"><a class="swift-search-link" href="#"><i class="fa-search-plus"></i><span>'.do_shortcode($tb_search_text).'</span></a></li>'. "\n"; } else { $woo_links_output .= '<li class="hs-woo-custom clearfix"><a class="swift-search-link" href="#"><i class="fa-search-plus"></i><span>'.do_shortcode($tb_search_text).'</span></a></li>'. "\n"; } } $woo_links_output .= '</ul>'. "\n"; $woo_links_output .= '</nav>'. "\n"; // RETURN return $woo_links_output; } }
-Rui
April 27, 2015 at 11:20 am #168991Hi,
Please dont make this small change like this. Please install and use this plugin https://wordpress.org/plugins/real-time-find-and-replace/ at Admin -> Tools . You can change this text easily through this plugin.
Thanks
MohammadApril 27, 2015 at 2:08 pm #169060Hi,
Nothing wrong in my change suggestion, it’s just a better way to achieve the same you already did.
Mohammad alternative will replace all the words “Welcome” in the site by the word “Hello” and sometimes that’s not the desired.
-Rui
April 27, 2015 at 2:41 pm #169071Thanks Rui,
yes i need to redo functions: the hello was just one example, but i need to realign the header with subscription being last and my account first etc.
April 27, 2015 at 2:46 pm #169073no problem.
-RuiApril 27, 2015 at 2:57 pm #169077Brilliant works like a charm. Cannot thank you enough!
April 27, 2015 at 2:59 pm #169081Great. Glad it’s sorted.
-Rui -
Posted in: Neighborhood
You must be logged in and have valid license to reply to this topic.