How to include a php file in WordPress?

By | April 14, 2021

If you are dealing with wordpress coding and wish to include a file in your coding, you can simply give the path to the file and add it in the following manner,

 

require_once( plugin_dir_path( __FILE__ ) . ‘fileyouwanttoadd.php’ );

Leave a Reply

Your email address will not be published. Required fields are marked *