Changes in single post without altering the code
-
Hello,
I have a question about changes done to a single post file. I want to add side menu to a custom post type. I added this code to the function.phpfunction register_my_menu() { register_nav_menu('new-menu',__( 'New Menu' )); } add_action( 'init', 'register_my_menu' );
and then the code below to my single-custom-post.php file.
<?php wp_nav_menu( array( 'theme_location' => 'new-menu' ) ); ?>
My concern here is if at some stage my theme gets updated the changes in single-custom-post.php will be erased. How can I make them permanent? I was thinking about making a copy and renaming the file, but how would I force WordPress to use the new copied file instead the original? Or maybe there is another way? Thanks.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Changes in single post without altering the code’ is closed to new replies.