child theme problems with adding some scripts
The problem I get, it takes along time. It is about adding some application scripts which are related to third party websites. When I try to add them into functions.php file in my child theme, I get that classical warning about ” ….Cannot modify header …..sent by (outsourced of …../child-theme/functions.php 12…14…etc ) … /wp-icludes/pluggable.php 880 …. ” . And then I can’t log into my wp-admin !
Anyway…when I try to contact to my host provider, they told me that cause of my theme. So, I am here to get the right solution. BTW, I try to complete and solve that solution whether if there is an opening before or at the end of ( <?php , <?). So, it didn’t help me.
I hope, I don’t do anything false…because as far as I know, I should put those kind of codes in functions.php. Well, some codes should be added before <head> or <body> tags and so on. Or not ??!
Because of this problem, I can’t use some applications properly.
Well,maybe I wrote a little confusing..but this is my case too… 🙂 So,could anyone help me please ?
Ohhh…btw..my site is : http://merryandhealthy.comMod
I get this error always when I click on my dashboard-widgets and gaphene options ;
” Warning: Cannot modify header information – headers already sent by (output started at …. /public_html/wp-content/themes/graphene-child/functions.php:12) in ….. /public_html/wp-includes/pluggable.php on line 880 “
I had installed a quantcast code in my childtheme functions.php file.So, I deleted it but it still appears at me ! The weird thing in this matter, when I delete quantcast code, then on my website disappears another application by another site ( SiteLock Seal ).
Can anyone help me, please ?ModQuote:Warning: Cannot modify header information – headers already sent by (output started at …. /public_html/wp-content/themes/graphene-child/functions.php
The infamous “Cannot modify header information” error message in WordPress is usually caused by having characters (a space, a line return) before the opening
<?phptag or after the closing
?>php tag. Take those out, reupload the functions.php file, and you should be good.
<!-- Quantcast Tag -->
This is what I have in my function.php. But this works well for a long time,actually since I changed the header image. So, where is the problem in this ? Could you make it clearer for me please ?Mod
I wonder why would need to throw that custom header height and width function to your child theme’s functions.php?! You can change the header image height in Graphene Options itself. And, the header width will be changed according to the container width you’ve set in column width settings.
Ooopss! I really don’t remember it why I did. You’re absolutely right. I think, I was a little tipsy ! :))
Anyway, I deleted my function.php in my child theme so it is totally free now and after that, except of an app ( sitelock seal ), all other functions work well.
So…at the moment…
Could you tell me when I need to insert a snippet code by other websites, where I have to put those codes in my child theme ?
OK, already I know that, if it is before header I can put it into theme’s advanced option-custom header tag section. But if it should be before </body> tag in theme, so where I have to put it, I dont know.
Could you make this issue clear for me, please ?ModQuote:But if it should be before </body> tag in theme, so where I have to put it, I dont know.
Try dropping it into an action hook widget area. But honestly, it depends upon the code and what it is supposed to do. It is difficult to give you precise instructions without knowing or seeing this code. Does the code documentation say anything?
Thanks a lot Kenneth for response, actually I’d like to add three apps codes. 2 of them should be inserted before </body> tag in theme and other one before </head> tag. These are simple generated codes by third party website apps. They are quantcast,uservoice and sitelock trust seal apps.
Which actions hook is the right one,I’m not sure…Could you tell me exactly please ?ModQuote:Which actions hook is the right one,I’m not sure
It depends on what they do. If they merely add functionality to your website, you could put them just about anywhere. (The header widget, for example.) If they need to appear in a specific place on each web page, you’ll have to make some educated guesses about which action hook widget area to use.
I have never heard of these apps and have no familiarity with them. Is there documentation available for them? (iow, throw us a link).
You must be logged in to reply to this topic.