Title: Template Override
Last modified: February 23, 2025

---

# Template Override

 *  [ibro87](https://wordpress.org/support/users/ibro87/)
 * (@ibro87)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/template-override-39/)
 *     ```wp-block-code
       Hi there, First of all, great plugin! I'm trying to override login.php form with my own without modifying core plugin files. For this reason, I have created a child plugin following the same plugin structure (e.g. /wp-content/plugins/ajax-login-and-registration-modal-popup-pro-child-plugin/free/views/form-parts/login.php). I've placed the main .php file (login-registration-modal-pro-child-plugin.php) within the child plugin folder, telling WordPress to use this instead of the parent plugin. Here's the code I used:<?php// Hook to override the login form template in the parent pluginadd_filter('lrm/login_form_template', 'custom_login_form_template', 10, 2);function custom_login_form_template($template, $args) {// Check if the parent plugin is activeif (is_plugin_active('ajax-login-and-registration-modal-popup-pro/login-registration-modal-pro.php')) {// Provide the path to the modified login.php in your child plugin$template = plugin_dir_path(FILE) . 'free/views/form-parts/login.php';}return $template;}FYI, both parent and child plugins are active. However, this didn't work and login.php file was still loaded from the parent plugin which is not what I want because I want to preserve my changes even when parent plugin is updated. Could it be that I used the wrong filter? If so, could you please tell me correct one which renders login form and point me in the right direction to make this work. Many thanks in advance! 
       ```
   
    -  This topic was modified 1 year, 1 month ago by [ibro87](https://wordpress.org/support/users/ibro87/).
    -  This topic was modified 1 year, 1 month ago by [ibro87](https://wordpress.org/support/users/ibro87/).

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

 *  Plugin Author [Max K](https://wordpress.org/support/users/kaminskym/)
 * (@kaminskym)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/template-override-39/#post-18336310)
 * Hey,
 * Unfortunately I can’t find that filter _‘lrm/login\_form\_template’_ inside the
   plugin, I’ll try to add it and will let you know.
 * Max
 *  Thread Starter [ibro87](https://wordpress.org/support/users/ibro87/)
 * (@ibro87)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/template-override-39/#post-18339496)
 * Hi there, 
   Sounds good. In the meantime, could you please clarify which existing
   filer can be used in order to override original login.php file? Thanks again!
 *  Thread Starter [ibro87](https://wordpress.org/support/users/ibro87/)
 * (@ibro87)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/template-override-39/#post-18347163)
 * For example: WooCommerce gives very clear instructions how to override their 
   templates (“This template can be overridden by copying it to yourtheme/woocommerce/
   myaccount/my-downloads.php.”). This works, so if you could do the same for your
   plugin, that would be very helpful.

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

The topic ‘Template Override’ is closed to new replies.

 * ![](https://ps.w.org/ajax-login-and-registration-modal-popup/assets/icon-128x128.
   jpg?rev=2185221)
 * [AJAX Login and Registration modal popup + inline form](https://wordpress.org/plugins/ajax-login-and-registration-modal-popup/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ajax-login-and-registration-modal-popup/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ajax-login-and-registration-modal-popup/)
 * [Active Topics](https://wordpress.org/support/plugin/ajax-login-and-registration-modal-popup/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ajax-login-and-registration-modal-popup/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ajax-login-and-registration-modal-popup/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [ibro87](https://wordpress.org/support/users/ibro87/)
 * Last activity: [1 year, 1 month ago](https://wordpress.org/support/topic/template-override-39/#post-18347163)
 * Status: not resolved