Adding functions.php file to child theme

  • Unknown's avatar

    Hi

    I need to add the functions.php file to my child theme. I have been reading how to do it but I’m still not quite getting it and the code I am adding is causing blank pages to load. What I am trying to do is alter the existing viewport meta tag. This is what I want to change it to: <meta name=”viewport” content=”width=device-width, initial-scale=1.0″ />

    Below is the exact code I have added to the functions.php file in my child theme folder. I don’t know what I am doing wrong. I must be missing something. Thanks for any help :)

    <?php

    function et_add_viewport_meta(){
    echo ‘<meta name=”viewport” content=”width=device-width, initial-scale=1.0″ />’;
    }
    add_action( ‘wp_head’, ‘et_add_viewport_meta’ );

  • Hi there,

    This question is better suited to the self-hosted WordPress forums. It’s not possible to use child-themes on WordPress.com except with the Business Plan, and most of the users who post in these forums don’t really have experience with child themes, or anything regarding the development side of WordPress.

    You can find the self-hosted forums here:

    https://wordpress.org/support/

  • Unknown's avatar

    oh, ok. thanks for pointing me in the right direction. :)

  • My pleasure. I hope you get an answer to your question over there :)

  • The topic ‘Adding functions.php file to child theme’ is closed to new replies.