Home Forums Free Themes Photo Perfect Can't used custom.php in child theme

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #8555
    Chavagne
    Participant

    Hi 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
    Chavagne

    #8566
    wensolutions
    Keymaster

    Hello,

    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,

    #8570
    Chavagne
    Participant

    Thank you very much.

    I tried to changed function in custom.php file but I had to change it in function.php file.

    Thank you.

    #8621
    wensolutions
    Keymaster

    You are welcome,
    Thank you for the appreciation.

    Best regards.

    #8624
    wensolutions
    Keymaster

    Hello @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-perfect

    Regards!!
    CHEERS

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