I'm trying to override this Dokan plugin file in a child theme:


I can successfully override files in the normal Dokan templates folder:


by using


However, because the file I wish to override is in the includes folder, I'm having trouble finding the correct file path to override the verification-new.php file.

Any ideas?

P.S. The reason why I wish to override the file in a child theme rather than simply edit the original is so I can update Dokan and not lose the changes.

  • 1
    Keep in mind that Dokan Pro is a premium theme, 3rd party themes are offtopic here
    – Tom J Nowell
    Nov 12, 2019 at 18:55
  • Thanks, I didn't know that. Nov 13, 2019 at 19:12
  • Don't upload files to dokan-pro, just dokan Nov 6 at 14:32

3 Answers 3


Child themes let you override templates, but these are not templates you're attempting to override. You can't drop in arbitrary files and override the parent theme, and WordPress can't do it's magic when include or require are used to load files.

The reason this works for templates, is because WordPress doesn't load them with include, instead it uses filterable functions with custom logic, such as get_template_part.

So there is no way to use the child theme method to swap out that file. You do have the advantage that the child themes functions.php loads first.

Instead, you're going to have to look at how the code in that theme loads itself, if it provides filters and actions, etc, much like you would when trying to override plugin code.

You'll need to contact the vendor for documentation and support, afterall you're a paying customer.


I was atttempting the same purpose.

Dokan support has confirmed that only files contained in the dokan templates/ directory can be overriden in your theme.

If you need to override modules's templates, I suggest to use this filter provided by dokan : 'dokan_locate_template'

You can use it in your child-theme functions.php like this :

add_filter('dokan_locate_template', 'childtheme_dokan_locate_template', 20, 3);
function childtheme_dokan_locate_template($template, $template_name, $template_path) {
    if ( preg_match('/\/modules\//i', $template) ) {
        $theme_template = str_replace(DOKAN_PRO_DIR . "/", get_stylesheet_directory() . '/' . dokan()->template_path(), $template);
        if ($template != $template_name && file_exists($theme_template)) {
            $template = $theme_template;
    return $template;

This code allows to override Dokan PRO modules templates in your child theme.


is overriden by this one


Hope it helps.


To update Jo Kolov's answer, it almost works. But you have to change this line :

add_filter('dokan_locate_template', 'childtheme_dokan_locate_template', 20, 3);

To :

add_filter('dokan_get_template_part', 'childtheme_dokan_locate_template', 20, 3);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.