Title: code in theme / code in child-theme
Last modified: August 21, 2016

---

# code in theme / code in child-theme

 *  [NollieHeel](https://wordpress.org/support/users/nollieheel/)
 * (@nollieheel)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/code-in-theme-code-in-child-theme/)
 * I think I _may_ have a fundamental misunderstanding of the way child themes –
   and the content in their folders – correspond with the parent theme that is used.
 * for example, in my header.php of my child theme, it shows _some_ of the lines
   of code at the top, but not _all_ of it. Besides, some code is PHP, which is ‘
   invisible’ when looking at the source code in a browser.
 * I’m hoping my thread points out something that other users like myself don’t 
   grasp.
 * for example, I ‘thought’ that the ONLY script that ran before the rest of my 
   code was
 * >  <script type=”text/javascript” src=”[http://www.site.com/wp-content/themes/mckinley-child/js/modernizr.custom.24147.js”></script&gt](http://www.site.com/wp-content/themes/mckinley-child/js/modernizr.custom.24147.js”></script&gt);
   > </head>
 * inside my header.php.
 * When in fact, while trying to debug some js/css issues, I noticed that above 
   the modernizr.js line, the page source showed
 * >  <![endif]–>
   >  <script type=’text/javascript’ src=’[http://www.site.com/wp-includes/js/comment-reply.js?ver=3.8.1′></script&gt](http://www.site.com/wp-includes/js/comment-reply.js?ver=3.8.1′></script&gt);
   > <script type=’text/javascript’ src=’[http://www.site.com/wp-includes/js/jquery/jquery.js?ver=1.10.2′></script&gt](http://www.site.com/wp-includes/js/jquery/jquery.js?ver=1.10.2′></script&gt);
   > <script type=’text/javascript’ src=’[http://www.site.com/wp-includes/js/jquery/jquery-migrate.js?ver=1.2.1′></script&gt](http://www.site.com/wp-includes/js/jquery/jquery-migrate.js?ver=1.2.1′></script&gt);
   > <link rel=”EditURI” type=”application/rsd+xml” title=”RSD” href=”[http://www.site.com/xmlrpc.php?rsd&#8221](http://www.site.com/xmlrpc.php?rsd&#8221);/
   > > <link rel=”wlwmanifest” type=”application/wlwmanifest+xml” href=”[http://www.site.com/wp-includes/wlwmanifest.xml&#8221](http://www.site.com/wp-includes/wlwmanifest.xml&#8221);/
   > > <link rel=’next’ title=’Second Page’ href=’[http://www.site.com/home/second-page/&#8217](http://www.site.com/home/second-page/&#8217);/
   > > <meta name=”generator” content=”WordPress 3.8.1″ /> <link rel=’canonical’
   > href=’[http://www.site.com/&#8217](http://www.site.com/&#8217); /> <link rel
   > =’shortlink’ href=’[http://www.site.com/?p=281&#8242](http://www.site.com/?p=281&#8242);/
   > > <style type=”text/css”>.recentcomments a{display:inline !important;padding:
   > 0 !important;margin:0 !important;}</style>
   > >  so after seeing this code, I realized some scripts were actually being loaded
   > > _before_ my modernizr.js! When I had thought all along that modernizr.js 
   > > was the first javascript to run on the page.
   > > my point is, that there’s more than meets the eye with certain files such
   > > as header.php.
   > >  I had mistakenly thought that when my page loads, that the
   > > very first character the browser even _reads_ on your page is inside header.
   > > php, when in fact, it is _outside_ of header.php.
   > > Can anybody confirm my theory?
   > >  or post other topic threads that will help
   > > my understanding of wordpress and how it organizes itself with child themes?

Viewing 1 replies (of 1 total)

 *  [Pioneer Web Design](https://wordpress.org/support/users/swansonphotos/)
 * (@swansonphotos)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/code-in-theme-code-in-child-theme/#post-4759246)
 * Many plugins and themes use wp_head to hook actions, etc
 * [http://codex.wordpress.org/Plugin_API/Action_Reference/wp_head](http://codex.wordpress.org/Plugin_API/Action_Reference/wp_head)

Viewing 1 replies (of 1 total)

The topic ‘code in theme / code in child-theme’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Pioneer Web Design](https://wordpress.org/support/users/swansonphotos/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/code-in-theme-code-in-child-theme/#post-4759246)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
