Editing RestaurantPress plugin’s file from plugin directory is not recommended as all the changes will be lost after upgrading.
So, RestaurantPress has introduced template files from Version 1.4.0 which contain the markup and template structure for frontend.
Template files can be found within the /restaurantpress/templates/ directory:
|V1.4.0||View template file|
On those files, you will see all the hooks that allow you to add or move content without needing to edit template files.
To override plugin’s template file:
- Create a folder naming restaurantpress inside your theme like: themes/yourtheme/restaurantpress.
- Copy the template file from plugins/restaurantpress/templates folder maintaining same folder structure to themes/yourtheme/restaurantpress directory created before.
Example: If you want to override One Column Layout, copy file one-column.php from wp-content/plugins/restaurantpress/templates/layouts/one-column.php to wp-content/themes/restaurantpress/layouts/one-column.php.
Now, the copied file will override the RestaurantPress default template file.
It means you can add/edit codes in the newly copied file to make changes to our plugin’s template file.