Tag Info

New answers tagged


Place your file in the same directory as the template. On the single.php and page.php files you'll want to include: <?php include('your_file.php'); ?>


In these cases, I usually use: include(locate_template('includes/form-views/view-profile')); In this way, a child theme can override the file.


When using plugin_dir_path() like you do: plugin_dir_path( __FILE__ ); It does return something like: /var/www//wordpress/wp-content/plugins/your-plugin/ So it adds a trailing slash, because as the documentation states: It is a wrapper for trailingslashit( dirname( $file ) );. So remove the slash before the file in your calls: require_once ...

Top 50 recent answers are included