Home › Forums › WordPress Themes – Premium › Lavish Pro › Recognise child theme files
Hi,
I’ve modified the template_functions.php and placed it in my chid theme, lavish-pro-child, but the changes ar not reflected on the site, it’s still picking up the original file in the parent theme. I’ve tried putting the file in the root of the child theme and also recreated the folder structure from the original theme and placed it in the same relative location as the original, but still no joy. Can you please give me a clue as to where I am going wrong?
Dear Clive,
Please paste this code on child theme funtions.php file to move below the header menu:
/**
* @return Remove hook
*/
add_action( 'wp_head', 'fr_child_remove_action' );
function fr_child_remove_action() {
remove_action( 'lr_header', 'lr_header_fnc' );
}
/**
* @return add header function to lr_header hook
*
*/
add_action( 'lr_header', 'fr_child_header_func' );
function fr_child_header_func() {
$header_style = get_theme_mod('header_style','one');
GLOBAL $post;
if( get_post_meta( $post->ID, '_lavish_hide-theme-header', true ) == 'on' ) {
$hide_header_class = "fr-lc-hide-header-section";
} else {
$hide_header_class = "";
}
switch ($header_style) {
case 'two':
$header_type = 'class="lavish_header header_one '.$hide_header_class.'"'; ?>
<div <?php echo $header_type; ?>><!--Header Starts Here-->
<div class="lavish_head">
<div class="container">
<?php logo_output(); ?>
<?php menu_output('navmenu');?>
</div>
</div>
<?php lr_social_icons_top_fnc('one'); ?>
<?php search_form_display(); ?>
<?php responsive_menu_output(); ?>
</div>
<?php
break;
case 'one':
$header_type = 'class="lavish_header header_two '.$hide_header_class.'"'; ?>
<div <?php echo $header_type; ?>><!--Header Starts Here-->
<div class="lavish_head">
<div class="container">
<?php logo_output(); ?>
<?php menu_output('navmenu');?>
</div>
</div>
<?php lr_social_icons_top_fnc('two'); ?>
<?php search_form_display(); ?>
<?php responsive_menu_output(); ?>
</div>
<?php
break;
}
}
Note: Please go on editing file only if you are technically sound on WordPress, otherwise you will be facing php error. and one more things you need adjust design by yourself.
Thanks
With our premium themes, we offer access to site documentation, video tutorials and timely support. Even if you have just started on WordPress, our support staff have the patience to help you create appealing sites gracefully.
Company
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.To find out more, including how to control cookies, see here: Privacy Policy
© Copyright © 2023 Styled Themes. All Right Reserved.