I am trying to include a file in a different directory using a relative file path however I keep getting the error:
failed to open stream: No such file or directory
The path of the file calling the include statement is
wp-content/plugins/php-code-widget/execphp.php
and the file I’m trying to include is
wp-content/uploads/espresso/templates/sidebar_widgets/register_widget.php
This is my include statement:
<?php include ('../../uploads/espresso/templates/sidebar_widgets/register_widget.php ?>
Anyone see the problem?
I would avoid the relative path.
So long as WordPress hasn’t changed too much since I last used it, try something like…