Strict Standards: Redefining already defined constructor for class bbdb in /home/themes/public_html/forums/bb-includes/db-mysql.php on line 12

Strict Standards: Declaration of BB_Walker_Blank::start_lvl() should be compatible with BB_Walker::start_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_lvl() should be compatible with BB_Walker::end_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::start_el() should be compatible with BB_Walker::start_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_el() should be compatible with BB_Walker::end_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Warning: Cannot modify header information - headers already sent by (output started at /home/themes/public_html/forums/bb-includes/db-mysql.php:12) in /home/themes/public_html/forums/my-templates/kakumei-variant/rss2.php on line 1
ThemeShaper Forums Topic: Adding code to header.php http://forums.themeshaper.com/ Help In Shaping WordPress Themes en Sat, 23 May 2015 05:46:45 +0000 helgatheviking on "Adding code to header.php" http://forums.themeshaper.com/topic/adding-code-to-headerphp#post-22801 Mon, 22 Aug 2011 14:55:29 +0000 helgatheviking 22801@http://forums.themeshaper.com/ <p>no idea what the photo lovers theme is and why thematic should be compatible. but if you look at header.php you will see </p> <pre><code>// Creating the head profile thematic_head_profile();</code></pre> <p>then if you look in library/extensions/header-extensions.php you'll see that function defined as:</p> <pre><code>// Creates the HEAD Profile function thematic_head_profile() { $content = &#39;&lt;head profile=&quot;http://gmpg.org/xfn/11&quot;&gt;&#39; . &quot;\n&quot;; echo apply_filters(&#39;thematic_head_profile&#39;, $content); } // end thematic_head_profile</code></pre> <p>so boom, we've found where the head tag opens AND there is a filter we can latch on to</p> <pre><code>function filter_head($content){ return $content . &#39;&lt;meta http-equiv=&quot;bacon&quot;/&gt;&#39;; } add_filter(&#39;thematic_head_profile&#39;,&#39;filter_head&#39;);</code></pre> <p>should get my useless bacon tag just after the head tag opens </p> evis on "Adding code to header.php" http://forums.themeshaper.com/topic/adding-code-to-headerphp#post-22781 Sun, 21 Aug 2011 09:35:28 +0000 evis 22781@http://forums.themeshaper.com/ <p>I'm having problems with compability using the Thematic and Photo Lover themes. I'm not trying to add the add_browser_test to my functions.php but it doesn't help.</p> <p>I changed the code to add a third argument '1' to place the code first in the &lt;head&gt; tag, as I know this has helped before, but this doesn't place the code first after the &lt;head&gt; tag, only a bit higher up than it did without the argument...</p> <p>I really need to fix this in my project. Is there no plans to fix this in the themes? Or could you assist in how I can add the code where I want it? </p> helgatheviking on "Adding code to header.php" http://forums.themeshaper.com/topic/adding-code-to-headerphp#post-22675 Sat, 13 Aug 2011 04:59:31 +0000 helgatheviking 22675@http://forums.themeshaper.com/ <p>you get white screens of death usually when you have an error in the code somewhere. parse errors (missing } , ; ) type characters). </p> <pre><code>if ( isset($_GET[&#39;debug&#39;]) &#38;&#38; $_GET[&#39;debug&#39;] == &#39;debug&#39;) define(&#39;WP_DEBUG&#39;, true);</code></pre> <p>add that to your wp_config.php file (in the wp root directory)</p> <p>then visit your site at</p> <p>yoursite.com?debug=debug</p> <p>will show you error messages that live sites often suppress, but that are helpful for figuring out where the error comes from.</p> <p>i did just test this locally, by pasting it into a theme i'm working on and it didn't break. so i am guessing it isn't the above code. </p> aberrant on "Adding code to header.php" http://forums.themeshaper.com/topic/adding-code-to-headerphp#post-22673 Sat, 13 Aug 2011 03:57:57 +0000 aberrant 22673@http://forums.themeshaper.com/ <p>Even without adding this code, if I have a copy (exact copy from the thematic directory) of the functions.php file in my child theme directory, my site goes down. Not sure why it's doing this... </p> sowingseeds on "Adding code to header.php" http://forums.themeshaper.com/topic/adding-code-to-headerphp#post-22672 Sat, 13 Aug 2011 03:34:10 +0000 sowingseeds 22672@http://forums.themeshaper.com/ <p>Did you add it at the end - after the ?&gt;<br /> It needs to be placed before the final closing ?&gt;. </p> aberrant on "Adding code to header.php" http://forums.themeshaper.com/topic/adding-code-to-headerphp#post-22671 Sat, 13 Aug 2011 02:48:47 +0000 aberrant 22671@http://forums.themeshaper.com/ <p>Sowingseeds, </p> <p>Yes, the site went blank after copying the functions.php file to my child theme directory, but I deleted it and everything is back to normal. I'm curious as to why the site went blank after just copying this file to my child theme directory...any ideas?</p> <p>I have a bunch more code after <code>// define(&#39;THEMATIC_COMPATIBLE_FEEDLINKS&#39;, true);</code> in the functions.php file that is within the thematic directory.</p> <p>Thanks for the help.</p> <p>-A </p> sowingseeds on "Adding code to header.php" http://forums.themeshaper.com/topic/adding-code-to-headerphp#post-22670 Sat, 13 Aug 2011 02:29:52 +0000 sowingseeds 22670@http://forums.themeshaper.com/ <p>OK... first the code is untested, in terms of doing what you want, but it will not break your theme. If your site has gone blank I presume you cannot access the dashboard?</p> <p>You will need to download the childtheme functions.php and edit and then upload again.</p> <p>Sorry if I am asking the basics, but<br /> 1) you have a child theme you activated... assuming yes. You do not change any thematic files only the ones in your child theme.<br /> 2) There you have a style.css and a functions.php<br /> 3)Enter the code on a new line after what is probably the last current line there<br /> // define('THEMATIC_COMPATIBLE_FEEDLINKS', true);<br /> So... function add_browser_test(){<br /> through to<br /> add_action('wp_head','add_browser_test');</p> <p>That code will not break your theme - make sure you have the code as is above.</p> <p>If however you can access your dashboard and the site is blank then there is a conflict elsewhere. </p> aberrant on "Adding code to header.php" http://forums.themeshaper.com/topic/adding-code-to-headerphp#post-22669 Sat, 13 Aug 2011 02:01:58 +0000 aberrant 22669@http://forums.themeshaper.com/ <p>Hi sowingseeds, </p> <p>Hmmm, when I copy the functions.php file to my child theme folder, my site goes blank. Do I make a completely new functions.php file with only the code above in it? Would I leave the other fuctions.php file in the thematic folder?</p> <p>I'm using Easing Slider: <a href="http://www.easingslider.matthewruddy.com/" rel="nofollow">http://www.easingslider.matthewruddy.com/</a></p> <p>I'm trying to resolve an issue in IE9 where the slider will only work after a refresh of the page. This code was actually on the premium slider version page (http://www.premiumslider.matthewruddy.com/) but I'm assuming it will work on this version just the same since it is only a browser hack of sorts.</p> <p>-A </p> sowingseeds on "Adding code to header.php" http://forums.themeshaper.com/topic/adding-code-to-headerphp#post-22620 Thu, 11 Aug 2011 08:07:31 +0000 sowingseeds 22620@http://forums.themeshaper.com/ <p>In your child theme's functions.php enter the code as given by helgatheviking (removing what you had added to the header.php).</p> <p>The wp_head hook is being called in the last line of code. It is not in thematic - but part of wordpress. As said the code is untested.</p> <p>Which slider are you using? Maybe if the code does not work as is that there is another way of making it work in wp. </p> aberrant on "Adding code to header.php" http://forums.themeshaper.com/topic/adding-code-to-headerphp#post-22609 Thu, 11 Aug 2011 01:52:32 +0000 aberrant 22609@http://forums.themeshaper.com/ <p>Hi heigatheviking, </p> <p>Thanks so much for your help. So I would just copy and paste this function code into my functions.php file (make a copy and place it in my child theme folder) and that's it? Or do I have to add something somewhere else as well? I don't know what you mean by "add it to the wp_head hook". There is no wp_head hook in the functions.php file...</p> <p>Sorry I'm still a noob with PHP stuff!</p> <p>Thanks again for your help!</p> <p>Cheers, </p> <p>-A </p> helgatheviking on "Adding code to header.php" http://forums.themeshaper.com/topic/adding-code-to-headerphp#post-22590 Wed, 10 Aug 2011 04:07:49 +0000 helgatheviking 22590@http://forums.themeshaper.com/ <p>you don't add stuff to header.php when you are child-theming w/ thematic</p> <p>wrap it all up in a function in your functions.php and add it to the wp_head hook</p> <pre><code>function add_browser_test(){ $browser = $_SERVER[&#39;HTTP_USER_AGENT&#39;] . &quot;\n\n&quot;; $search = strpos( $browser, &#39;Win64&#39; ); if ( $search != false &#38;&#38; $search != 0 &#38;&#38; $search != &#39;&#39; ) { // This is for IE9 64-bit. echo &#39;&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=EmulateIE8&quot;/&gt;&#39;; } else { // And this is for IE9 32-bit. echo &#39;&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=8&quot;/&gt;&#39;; } } add_action(&#39;wp_head&#39;,&#39;add_browser_test&#39;);</code></pre> <p>totally untested, ymmv </p> aberrant on "Adding code to header.php" http://forums.themeshaper.com/topic/adding-code-to-headerphp#post-22587 Tue, 09 Aug 2011 23:00:15 +0000 aberrant 22587@http://forums.themeshaper.com/ <p>Hello,</p> <p>I am trying to fix an issue with a jquery slider I have installed on my site and was told to place this code into the header.php file.</p> <pre><code>&lt;?php $browser = $_SERVER[&#39;HTTP_USER_AGENT&#39;] . &quot;\n\n&quot;; $search = strpos( $browser, &#39;Win64&#39; ); if ( $search != false &#38;&#38; $search != 0 &#38;&#38; $search != &#39;&#39; ) { // This is for IE9 64-bit. echo &#39;&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=EmulateIE8&quot;/&gt;&#39;; } else { // And this is for IE9 32-bit. echo &#39;&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=8&quot;/&gt;&#39;; } ?&gt;</code></pre> <p>However, I do not know exactly where to put it. It says to place the code in the head tags, but after placing right before the first &lt;/head&gt; tag, I experienced a database error on my site.</p> <p>Any help is greatly appreciated. </p>