It has me absolute stumped!
I've got a small snippet of PHP code,
<?php include('/includes/stuff.php'); ?>. All it will is output a picture.
Basically put this within the Wordpress styles header.php or index.php files, it'll never appear. This is actually the actual code during my the styles index.php file:
<img src="<?php bloginfo('stylesheet_directory');?>/images/content-top.gif" alt="content top" class="content-wrap" /> <?php include('/includes/stuff.php'); ?> TEST TEST TEST //this is the custom code <div id="content">
However when it really runs, it appears like:
<img src="http://www.bavarianblue.com/wp-content/themes/Polished/images/content-top.gif" alt="content top" class="content-wrap" /> <div id="content">
It simply ignores my code entirely. No errors, no nothing.
The only real time I possibly could get results is that if I incorporated it within an already incorporated file. For example, in header.php there's an include for any features.php. Basically incorporated it there, it labored fine. But I'm not going it there, I want it in index.php.
Can there be some type of configuration in wordpress where's must know all includes or something like that? I confirmed that my files are now being modified (around the FTP).
I simply attempted get_template_part(), as referred to around the wordpress codex, with no success. This is actually the snippet I attempted:
<?php get_template_part( 'includes/stuff' ); ?>
Try the entire road to stuff.php. Also, your host may be running php in safe mode, check your file permissions.
A different way to include php functions in WordPress is by the functions.php file inside your theme: http://codex.wordpress.org/Theme_Development#Functions_File
I've no clue why, but altering the index.php files does nothing for that theme. I must change include/default.php - both index.php and default.php have similar designs (elements of the identical title). Actually, basically remove index.php in the theme entirely, it's no effect online. Whomever coded the theme was a little lazy...