• Resolved aliraza7

    (@aliraza7)


    I had successfully made a child theme and worked on it. When my website was completed i copied “content.php” and “functions.php” from my parent theme to child theme i order to make a backup (in which i was wrong).
    Now i found that content.php and functions.php should not be copied to child theme only style.css is necessary. when i delete those files from my child theme ,my style.css stopped working now . please help me….i tried to make a fresh copy of ” functions.php” file in my child theme but when i tried to enqueue it using:

    add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' );
    function enqueue_parent_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
    }

    the error has shown up :

    add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' ); function enqueue_parent_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' ); }
    Warning: Cannot modify header information - headers already sent by (output started at /home1/aliraza7/public_html/wp-content/themes/twentythirteen-child/functions.php:4) in /home1/aliraza7/public_html/wp-includes/pluggable.php on line 1178

    please help me ASAP i dont wana loose my work all again.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Can you post the contents of your child theme’s functions.php to Pastebin and post the link here?

    Thread Starter aliraza7

    (@aliraza7)

    actually i have made a child theme just for a backup and my website is simple, i dont know much of php so i didn’t bothered to change/add something to functions.php ,
    besides i just added the code to enqueue my style.css
    http://pastebin.com/r6Cw7jCj

    Is that your entire functions.php? Do you have the opening <?php tag? If not, it needs to be on a line by itself and it should be the very first thing in the file: no spaces, tabs, line breaks, etc., before it:

    <?php
    
    add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' );
    function enqueue_parent_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
    }
    Thread Starter aliraza7

    (@aliraza7)

    OMG!!Thank you so much, Actually i have been working on my project from last 7-8 hours and my mind is so exhausted.
    I can’t believe i was missing the starting tag.i think i need a break from work now.

    Anyways thanks!
    🙂

    Thread Starter aliraza7

    (@aliraza7)

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

The topic ‘CSS not working in child theme’ is closed to new replies.