How Can We Help?

Template overriding

< All Topics

Overriding template files 

WP food Manager Plugin has a “templates” directory which contains all the template files that create the frontend view of your food menu. This “templates” folder also includes “form-fields” directory which contains all the form control template files.
Template Files

Overriding template files through a theme

You can customize the template file by overriding it via your theme.

  1. Create a new folder “wp-food-manager” inside your theme folder. e.g yourtheme/wp-food-manager.

For example, you want to override plugins/wp-food-manager/content-food_listing_type.php, then you can copy this file into yourtheme/wp-food-manager. Here we have shown an example with a WP Food Listing theme.
Template Files Override

Update the custom version in the future to maintain compatibility if the files are updated in the core plugin. Hence the template file which needs to be customized should only be customized.

Overriding template file through code

WordPress Plugin developers can also override template files by applying the “food_manager_locate_template” filter.

This will return the template path which is going to be overridden.

Table of Contents