• bostjanlaba

    (@bostjanlaba)


    If I create a function inside the Code Snippet, it works properly.

    But if I use “include (‘myfunctions.php’) and then define
    add_shortcode( ‘myFunc’, ‘MyFuncExt’ );

    and MyFuncExt is defined in the myfunctions.php, shortcode call [myFunc] does not work at all.

    Why can’t I use functions from external php file?

    Thanks

    Bostjan

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Where do you have the include ('myfunctions.php') line? (e.g. in a snippet, in a file, etc)

    Thread Starter bostjanlaba

    (@bostjanlaba)

    Hi, in the snippet.

    Plugin Author Shea Bunge

    (@bungeshea)

    Where is myfunctions.php located on the filesystem? You should specify an exact path instead of just including the filename.

    Thread Starter bostjanlaba

    (@bostjanlaba)

    I will try this, thanks.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Function from included php file not working’ is closed to new replies.