Home › Forums › Free Themes › Photo Perfect › Can't used custom.php in child theme
Tagged: child theme, custom.php, perfect photo
- This topic has 4 replies, 2 voices, and was last updated 8 years, 3 months ago by
wensolutions.
-
AuthorPosts
-
May 23, 2016 at 11:44 am #8555
Chavagne
ParticipantHi everybody,
I have some difficulties to customised my child theme.
Since I update theme (perfect photo free )to the last version, modifications in the custom.php file in my child-theme don’t work.
But if I change directly the custom.php of the orignial theme, I can see modification on my website.Can you help me to determine what’s wrong ?
Thanks
ChavagneMay 23, 2016 at 1:28 pm #8566wensolutions
KeymasterHello,
On your child theme you don’t have to copy the whole custom.php of the original theme but rather what you can do is copy the function you want to modify and put in on the functions.php of your child theme.
For example if you want to change the add primary navigation function just copy the function part which should be
function photo_perfect_add_primary_navigation(){ if ( ! has_nav_menu( 'primary' ) ) { return; } $header_menu_text = photo_perfect_get_option( 'header_menu_text' ); ?> <div id="main-nav" class="clear-fix"> <div class="container"> <nav id="site-navigation" class="header-navigation" role="navigation"> <button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false"><span><?php echo esc_html( $header_menu_text ); ?></span> <i class="fa fa-align-justify"></i></button> <div class="wrap-menu-content"> <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_id' => 'primary-menu', ) ); ?> </div><!-- .menu-content --> </nav><!-- #site-navigation --> </div> <!-- .container --> </div> <!-- #main-nav -->
and paste it on the child theme’s function.php .
I hope this helps solve your issue.
Best regards,May 23, 2016 at 2:51 pm #8570Chavagne
ParticipantThank you very much.
I tried to changed function in custom.php file but I had to change it in function.php file.
Thank you.
May 24, 2016 at 12:28 am #8621wensolutions
KeymasterYou are welcome,
Thank you for the appreciation.Best regards.
May 24, 2016 at 12:47 am #8624wensolutions
KeymasterHello @Chavagne
Nice to know that the problem has been solved. If there are any further query, then, please feel free to post them.
We will really appreciate if you could help us too by rating our theme in WordPress repo here:-
https://wordpress.org/support/view/theme-reviews/photo-perfectRegards!!
CHEERS -
AuthorPosts
- You must be logged in to reply to this topic.