• Hi there,

    I have the following code in my parent functions.php file that I would like to change:

    add_action( 'bizberg_top_header', 'bizberg_top_header_pro' );
    function bizberg_top_header_pro(){ 
    
    	$top_header_status = bizberg_get_theme_mod( 'top_header_status' );
    	$top_header_status_mobile = bizberg_get_theme_mod( 'top_header_status_mobile' );
    
    	/**
    	* @param $top_header_status (boolean)
    	* if true, don't show the top header
    	*/
    
    	if( $top_header_status == true ){
    		return;
    	} ?>
    
    	<div id="top-bar" class="<?php echo esc_attr( $top_header_status_mobile ? 'enable_top_bar_mobile' : '' ); ?>">
    		<div class="container">
    			<div class="row">
    				<div class="top_bar_wrapper">
    					<div class="col-sm-4 col-xs-12">
    
    						<?php 
    						bizberg_get_header_social_links();
    						?>
    
    					</div>
    					<div class="col-sm-8 col-xs-12">
    						<div class="top-bar-right">
    		                   	<ul class="infobox_header_wrapper">	                   		
    		                   		<?php 
    		                   		bizberg_get_infobox_header();
    		                   		?>
    		                   	</ul>
    	                    </div>
    					</div>
    				</div>
    			</div>
    		</div>
    	</div>
    
    	<?php
    }

    What is the best way to modify this code? If I paste the above code in my child theme function.php file, it creates an error.

    Or can I simple edit it in the parent functions.php file?

    Any suggestions would be great, thanks!

    • This topic was modified 4 years, 11 months ago by thetoolman123.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator t-p

    (@t-p)

    I have the following code in my parent functions.php file that I would like to change. If I paste the above code in my child theme function.php file, it creates an error

    I recommend asking at your theme’s support so the theme’s developers and support community can help you with this.

    Thread Starter thetoolman123

    (@thetoolman123)

    Thanks, but generally, what is the best method of editing functions.php files? Should it always be in a child theme or will it get overwritten if I change the parent functions.php?

    Moderator t-p

    (@t-p)

    Should it always be in a child theme

    Yes.

    will it get overwritten if I change the parent functions.php?

    yes. For this reason, consider creating a Child Theme.

    • This reply was modified 4 years, 11 months ago by t-p.
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘changing navigation from functions.php?’ is closed to new replies.