What is the error?

'op_1' => '<img src="<?php echo get_template_directory_uri(); ?>/inc/admin/images/lay_1.png" alt="Layout 1" title="Layout 1">',

This part is not working →

<?php echo get_template_directory_uri(); ?>

what is the error?

what should

mean for anyone who’s unable to read your mind?

2 Likes

this should execute something write →
<?php echo get_template_directory_uri(); ?>/inc/admin/images/lay_1.png

but it is getting printed like a string/text.

then your webserver is shut down (apache start), or the PHP interpreter does not work properly (php -v), or one of these is misconfigured, or you did not name the file according to the interpretation rules (like file.php)

Is that file saved with .php extension?

Are you testing it on a real server (or a local server)? Is php running? You can check for php by creating a php file containing the single line

<?php phpinfo(); ?>

If it is simply a file on your home computer and you are double-clicking the file to open it, the php is unlikely to work, as it has to be processed server side.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.