Theme Overrides Original Blog Templates - Fix

Very often Magento 2 themes override our original blog templates. As a result, you can't see posts on the post list or certain blocks in the blog pages. It could also be that posts are displayed, but when you go to a post view page, it is broken or shows an error.

It happens because vendors don't always make their theme compatible with the latest version of the Magento 2 Blog. Thus, the theme keeps using the blocks or functions that are changed in the latest version of the Blog extension.

So, if you've installed or updated the Magefan Blog Extension and some content is missing or not displayed properly on your blog, you've landed on the right page. Today you'll learn how to fix that.

Check If Your Theme Overrides Blog Template

Go to the app/design/frontend/Theme_Vendor/Theme_Name/ directory and check if there is the Magefan_Blog folder in this directory. If you have this folder, it means you have a customization for blog.

magento theme file structure

Remove Customization Completely

Sometimes you need to remove the customization completely, especially if you want to use Magefan Blog templates.

For that rename the Magefan_Blog folder in the app/design/frontend/Theme_Vendor/Theme_Name/ directory to Magefan_Blog_custom and run the following commands:

bin/magento setup:static-content:deploy

bin/magento c:f

This will disable all blog customizations. If you want to disable a customization partially, keep reading.

Revome Customization Partially

If you want to keep the blog customizations partially (e.g you have some custom blocks, colours or fonts), take the following steps:

1. Find the app/design/frontend/Theme_Vendor/Theme_Name/Magefan_Blog/ directory.

2. Rename the templates folder to templates_old and run the following commands:

bin/magento setup:static-content:deploy

bin/magento c:f

If your issue wasn't fixed continue working with the templates folder. You need to rename folders and templates in the templates folder, one by one, till you find which one causes the issue.

Note: it's important to redeploy Magento and clean caches after you rename each folder or template.

Once you find a template that causes the issue, just keep it renamed.

3. Move to the layout folder. Depending on the page the issue appears on you need to rename one of the following layouts:

  • Blog Main Page (blog_default, blog_post_list, blog_index_index)
  • Blog Category Page (blog_default, blog_post_list, blog_category_view)
  • Blog Post Page (blog_default, blog_post_opengraph, blog_post_richsnippets,
  • blog_post_view)
  • Search Result Page (blog_default, blog_post_list, blog_search_index)
  • Product Page (catalog_product_view)

Once you've renamed a corresponding layout, run:

bin/magento c:f layout

Same as in the previous case, keep a certain layout renamed once you find the one causing the issue.

That should be enough to fix the blog template. However, if the issue is still not fixed, please contact our team to request support.