• Resolved akacruiseman

    (@akacruiseman)


    Nobita,
    If I create a functions.php in the Child Theme folder will this totally overwrite the Main Theme functions.php OR will it use the Main Theme and only the code from the Child Theme?
    Thanks,
    Jim

Viewing 4 replies - 1 through 4 (of 4 total)
  • If you have a functions.php child theme activated and you were to just delete all the code I believe it would crash the site etc.

    That would be my guess.

    Theme Author nobita

    (@nobita)

    Hi akacruiseman

    first read the functions.php of child theme, and then read the functions.php of parent theme.

    php functions and variables of the parent theme, has been described in the pluggable.

    for example

    write your child themes functions.php

    if you overwrite function raindrops_posted_on()

    function raindrops_posted_on() {
    
     echo 'Your message';
    }

    Of course, You can use the filter

    add_filter( 'raindrops_posted_on', 'my_posted_on' );
    function my_posted_on( $posted_on_html ) {
    
     return 'Your message 2';
    
     //return $posted_on_html;
    }

    both same result.

    If you change default settings of parent functions vars.

    add_action( 'raindrops_last','my_custom_settings' );
    
    function my_custom_settings(){
     global $your_var;
      $your_var = 'your value';
    }

    Since I believe that important customization of from child theme, if you have any problem, please tell me.

    Thank you.

    @erik

    Please create new post and tell me your functions.php settings. 🙂

    @nobita I not have a question, was attempting to help @akacruiseman

    Thread Starter akacruiseman

    (@akacruiseman)

    Thanks @erik and @nobita.
    Although this all gave me a headache it has “forced” me to learn more.

    Closing this.

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

The topic ‘Child Theme and functions.php’ is closed to new replies.