Title: problem with add codes to function.php
Last modified: August 22, 2016

---

# problem with add codes to function.php

 *  [radvin](https://wordpress.org/support/users/radvin/)
 * (@radvin)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/problem-with-add-codes-to-functionphp/)
 * Hi. i want to create my first theme. i added my codes in header.php and function.
   php but my theme doesn’t know i added function.php to my theme at all!
    here 
   the codes in function.php:
 *     ```
       <?php
       DEFINE("THEME_LOC",get_template_directory_uri() );
       remove_action('wp_head','wp_generator');
       function enq_style(){
       wp_register_style('style',THEME_LOC.'/style.css',array(),'1','all',false);
       wp_enqueue_style('style');
       }
   
       add_action('wp_enqueue_scripts','enq_style');
       ?>
       ```
   
 * when i call THEME_LOC from header.php. it doesn’t know i stored my theme location
   into this constant.
    what’s the problem? shall i include my function.php into
   my theme or something? i’ve got another question too. does style.css add to my
   theme automatically or i have to register that style to my theme like what i 
   did in fucntion.php?

Viewing 1 replies (of 1 total)

 *  [Aman Verma](https://wordpress.org/support/users/efficientninja/)
 * (@efficientninja)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/problem-with-add-codes-to-functionphp/#post-5229505)
 * Hi radvin,
    firstly correct the name its “functions.php” not “function.php”. 
   Second you can include your “style.css” file in “header.php” file of your theme.

Viewing 1 replies (of 1 total)

The topic ‘problem with add codes to function.php’ is closed to new replies.

## Tags

 * [header.php](https://wordpress.org/support/topic-tag/header-php/)

 * 1 reply
 * 2 participants
 * Last reply from: [Aman Verma](https://wordpress.org/support/users/efficientninja/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/problem-with-add-codes-to-functionphp/#post-5229505)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
