417 posts Keep Walking
  • Has been part of the Envato Community for over 3 years
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Has collected 100+ items on Envato Market
+2 more
UXbarn says

Hi,

I would like to add those functions, for translation purpose, to the shortcode generator file which is in sub-folder of theme directory. It’s a general PHP file so once I added, the following error showed up:

Fatal error: Call to undefined function _e() in [file path].

Could you please advise how to achieve that?

Thanks in advance!

Paul

2025 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $250,000+ on Envato Market
  • Sells items exclusively on Envato Market
  • Contributed a free file of the month
+8 more
revaxarts says

You have to load WordPress

if ( !defined('ABSPATH') ) {
    /** Load WordPress Bootstrap */
    require_once('../../../wp-load.php');
}

You may have to change the path

417 posts Keep Walking
  • Has been part of the Envato Community for over 3 years
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Has collected 100+ items on Envato Market
+2 more
UXbarn says

That perfectly works! Thank you @revaxarts. :)

by
by
by
by
by
by