Title: Custom code in header does work.
Last modified: August 21, 2016

---

# Custom code in header does work.

 *  Resolved [bbloqx](https://wordpress.org/support/users/bbloqx/)
 * (@bbloqx)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/custom-code-in-header-does-work/)
 * Hey Greg, it me again.
 * Could you explain why custom code in header.php does work with Origami theme 
   but does with other themes?
 * For example, if I add the following to the header.php it does display the tree
   structure as it should.
 *     ```
       <link rel="stylesheet" href="/css/tree/jquery.treeview.css" />
       <script src="/js/tree/jquery.js" type="text/javascript"></script>
       <script src="/js/tree/jquery.cookie.js" type="text/javascript"></script>
       <script src="/js/tree/jquery.treeview.js" type="text/javascript"></script>
       <script type="text/javascript">
                $(function() {
                        $("#tree").treeview({
                               collapsed: true,
                               animated: "medium",
                               control:"#sidetreecontrol",
                               persist: "location"
                        });
                })
       </script>
       ```
   

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

 *  Thread Starter [bbloqx](https://wordpress.org/support/users/bbloqx/)
 * (@bbloqx)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/custom-code-in-header-does-work/#post-3946143)
 * Sorry I meant to say “doesnt work” and “doesnt display”, oooops.
 * Here is a sample of the beginning part of the code in the post:
 *     ```
       <div id="sidetree">
       <div class="tree header">
       <div id="sidetreecontrol"><a href="?#">Collapse All</a> | <a href="?#">Expand All</a>
       <ul id="tree">
       	<li><a name="A"><strong>A</strong></a>
       ```
   
 *  Thread Starter [bbloqx](https://wordpress.org/support/users/bbloqx/)
 * (@bbloqx)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/custom-code-in-header-does-work/#post-3946242)
 * Hello Greg,
 * Origami has passed 95% of our needed functionality but I’m at a stand still now.
 * I cannot seem to figure out why the above javascript doesnt work with Origami.
   I have tested it with other themes and it works fine.
 * In a nutshell, I have an “index” file with a couple thousand lines of code that
   I append to certain posts (not all but the one’s in the “Index” category). Rather
   than add the 2000 lines to each post, we use “WP File-Tree” shortcode to add 
   it to the relevant posts. The unordered list appears fine at the bottom of each
   post but the javascript to turn it into a tree structure does not.
 * For example the following unordered list does appear but again not in a tree 
   structure.
 *     ```
       <div id="sidetree">
       <div class="tree header">
       <div id="sidetreecontrol"><a href="?#">Collapse All</a> | <a href="?#">Expand All</a>
       <ul id="tree">
       	<li><a name="A"><strong>A</strong></a>
       		<ul>
       		<li>Actions,
       			<ul>
       			<li><a href="/beholding/">beholding</a>,</li>
       			<li><a href="/closeness/">closeness</a>,</li>
       			<li><a href="/concern/">concern of</a>,</li>
       			<li><a href="/fear/">fear of</a>,</li>
       			<li><a href="/hope/">hope in</a>,</li>
       			<li><a href="/love/">love of</a>,
       				<ul>
       				<li><a href="/true-love/">true-love</a>,</li>
       				</ul>
       			</li>
       			<li><a href="/pleasure/">pleasure</a>,</li>
       			<li><a href="/pride/">pride in</a>,</li>
       			</ul>
       		</li>
       		<li>Appetite,
       			<ul>
       			<li><a href="/losing/">losings one's</a>,</li>
       				<ul>
       				<li><a href="/to lose weigh">to lose weigh</a>,</li>
       				</ul>
       			</li>
       			<li><a href="/what-is-appetite">what is</a>,</li>
       			</ul>
       		</li>
       		<li>Apples, (See <a href="#fruits">Fruits</a>)</li>
       		</ul>
       	</li>
       </ul>
       </div>
       </div>
       </div>
       ```
   
 * Do you have any idea why this is? Or how we can resolve this problem?
 * Thanks
 *  Thread Starter [bbloqx](https://wordpress.org/support/users/bbloqx/)
 * (@bbloqx)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/custom-code-in-header-does-work/#post-3946246)
 * After tweaking with the css file and the placement of the javascript in the header,
   it NOW works 🙂
 *  [Greg – SiteOrigin](https://wordpress.org/support/users/gpriday/)
 * (@gpriday)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/custom-code-in-header-does-work/#post-3946247)
 * Hey BB
 * Glad you got it working. Just saw this thread now.
 * In general, I usually suggest using a plugin rather than editing theme files 
   directly. I’m not 100% sure, but this might work for you
 * [http://wordpress.org/plugins/css-javascript-toolbox/](http://wordpress.org/plugins/css-javascript-toolbox/)
 * It lets you add custom CSS and JS to your headers, without hacking files.
 *  Thread Starter [bbloqx](https://wordpress.org/support/users/bbloqx/)
 * (@bbloqx)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/custom-code-in-header-does-work/#post-3946281)
 * Hello Greg
 * Thanks for the reply and the suggested plugin. I’m trying to minimize the number
   of plugins to those we really need (not just like 🙂
 * I ended up created a child theme and I am modifying certain files within the 
   child directory.
 * I do have a short list of suggestions (which I think would make the theme even
   better) if your interested I will draft up some of my humble thoughts 🙂
 * I will update you with our url once we finish tweaking the look and feel.
 * Thanks
    Admin BBloqx com

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

The topic ‘Custom code in header does work.’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/origami/1.10.3/screenshot.png)
 * Origami
 * [Support Threads](https://wordpress.org/support/theme/origami/)
 * [Active Topics](https://wordpress.org/support/theme/origami/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/origami/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/origami/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [bbloqx](https://wordpress.org/support/users/bbloqx/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/custom-code-in-header-does-work/#post-3946281)
 * Status: resolved