Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
You’ll need a Child Theme for this kind of work.
Then copy the header.php file from your actual theme & paste it in your Child Theme directory.
You can then modify that header.php file in your Child Theme directory.
Tks for the reply, very useful,but I cannot still understand where to insert my code. My header.php file ends with:
<link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/favicon.ico" />
<?php endif; ?>
<?php wp_head(); ?>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/script.js"></script>
</head><?php } ?>
<body <?php if(function_exists('body_class')) body_class(); ?>>
<?php
ob_start();
I know that ob_start() is useful for data streaming, but what data exactly? So what the file I have to modify?
Do you have the child theme set up? What theme are you using?
where did you download that theme from?
what is the code of index.php of your theme?
Yes I set it now. The theme is “Agriculture Meadow”
The index.php is:
<?php
wp_get_header();
if (have_posts())
{
while (have_posts())
{
art_post();
}
art_page_navi();
} else {
art_not_found_msg();
}
wp_get_footer();
Moderator
Jan Dembowski
(@jdembowski)
Forum Moderator and Brute Squad
Can I convince you to switch to a theme from here and try your question again?
http://wordpress.org/extend/themes/
Or at least post a link to your site?
The reason it’s important to know where you got that theme is because the place that I found it contains really E-V-I-L obfuscated code in the functions.php
file on the site that I found it.
If you got that from a web site that has the letters generic
and wp
and themes
then you should delete it now. They’ve some really bad things there and we don’t support any of those themes here.
I’m really hoping you got the theme from the WordPress repo here. 😉
unfortunately, your current theme is not released under GPL, and is therefore not supported by this forum.
try contacting the theme’s download site for support.
The site is:
http://www.bewater.it/cerealbrenta/
Maybe I downloaded it from here:
http://[ redacted that site is not welcomed here ]/theme/agriculture-meadow.html
Tell me more about obfuscated code…
Moderator
Jan Dembowski
(@jdembowski)
Forum Moderator and Brute Squad
Obfuscated code is PHP code that you cannot decipher. The theme author is hiding Very Bad Things there and that is not GPL friendly at all.
You should not run any code that you can’t verify yourself by looking at the source code. They’re trying to do things with your blog that you would not do yourself and without your permission.
You can read about some of those dangers at this often quoted link.
http://www.chipbennett.net/2010/12/10/only-download-wordpress-themes-from-trusted-sources/
Best to be safe and avoid that site like a bad infection.