StyledThemes

Recognise child theme files

Home Forums WordPress Themes – Premium Lavish Pro Recognise child theme files

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #48215
    Clive Struver
    Participant

    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?

    #48227
    Sushil Adhikari
    Moderator

    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

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.