Title: changing navigation from functions.php?
Last modified: August 14, 2021

---

# changing navigation from functions.php?

 *  [thetoolman123](https://wordpress.org/support/users/thetoolman123/)
 * (@thetoolman123)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/changing-navigation-from-functions-php/)
 * 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](https://wordpress.org/support/users/thetoolman123/).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/changing-navigation-from-functions-php/#post-14766402)
 * > 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](https://wordpress.org/support/users/thetoolman123/)
 * (@thetoolman123)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/changing-navigation-from-functions-php/#post-14766406)
 * 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](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/changing-navigation-from-functions-php/#post-14766413)
 * > 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](https://developer.wordpress.org/themes/advanced-topics/child-themes/).
    -  This reply was modified 4 years, 11 months ago by [t-p](https://wordpress.org/support/users/t-p/).

Viewing 3 replies - 1 through 3 (of 3 total)

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [t-p](https://wordpress.org/support/users/t-p/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/changing-navigation-from-functions-php/#post-14766413)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
