Support » Fixing WordPress » include_once not working

  • Resolved jrcollins

    (@jrcollins)


    I’ve created a widget plugin and have placed the code for displaying the front end content in a separate file. I’m linking to the file using include_once but keep getting the error, failed to open stream: No such file or directory in...
    The plugin folder contains 2 sub-folders: includes and tpls The file I’m linking to is in the tpls folder and I’m linking to it from the includes folder.
    This is the code I’m using to link to the file:

    // Creating widget front-end
    public function widget( $args, $instance ) {
    
    include_once('../tpls/frontend.php' );
    }
    • This topic was modified 7 years, 6 months ago by jrcollins.
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘include_once not working’ is closed to new replies.