Hi @airidas, that’s very unusual. Does the theme allow you to use PHP in its templates? Make sure you’re not inserting this code already inside ‘<?php’ and ‘?>’.
Do you have any luck trying to insert the PHP code elsewhere? Somewhere else in the theme maybe?
Also, could you take a screenshot of the code where you are inserting the function? Just so I can make sure there aren’t any mistakes.
The code works in the theme when it is put through editor in header.php file.
The code of the template:
<?php get_header(); ?>
<div align="center">
<?php if ( function_exists( 'easingsliderlite' ) ) { easingsliderlite(); } ?>
</div>
<div id="main" class="row">
<div id="content" class="col12">
<div class="entry-description">
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'montezuma' ), 'after' => '</div>' ) ); ?>
</div>
<?php edit_post_link( __( "Edit", 'montezuma' ) ); ?>
<div class="post-footer">
</div>
</div>
<?php comments_template(); ?>
</div>
<?php get_footer(); ?>
Looking at the template itself, it seems that PHP code is used and working properly.
I think I know what is going wrong.
I’ve just downloaded and installed the Montezuma theme. It has its own in-built template editor, which I wasn’t aware of.
The editor is causing the problems. It’s not rendering the PHP correctly. It is possible that it is encoding the HTML character thus not actually executing PHP as it should.
Try editing the template via FTP (I don’t seem to be able to access the template files via the WordPress Theme Editor).
I’d also maybe get in contact with the developer(s) of Montezuma to let them know about the theme editor issue.
Thank you for your time! 🙂 I wish you happy coding…