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 here 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=”https://www.site.com/wp-content/themes/mckinley-child/js/modernizr.custom.24147.js”></script>
</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=’https://www.site.com/wp-includes/js/comment-reply.js?ver=3.8.1′></script>
<script type=’text/javascript’ src=’https://www.site.com/wp-includes/js/jquery/jquery.js?ver=1.10.2′></script>
<script type=’text/javascript’ src=’https://www.site.com/wp-includes/js/jquery/jquery-migrate.js?ver=1.2.1′></script>
<link rel=”EditURI” type=”application/rsd+xml” title=”RSD” href=”https://www.site.com/xmlrpc.php?rsd” />
<link rel=”wlwmanifest” type=”application/wlwmanifest+xml” href=”https://www.site.com/wp-includes/wlwmanifest.xml” />
<link rel=’next’ title=’Second Page’ href=’https://www.site.com/home/second-page/’ />
<meta name=”generator” content=”WordPress 3.8.1″ />
<link rel=’canonical’ href=’https://www.site.com/’ />
<link rel=’shortlink’ href=’https://www.site.com/?p=281′ />
<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?
- The topic ‘code in theme / code in child-theme’ is closed to new replies.