Hello All,
I want to override core block file i.e, (vendor/magento/module-theme/Block/Html/Topmenu.php) for my custom theme.
Can anyone suggest me anything for this.
Thanks
Hello Ankita,
You can override core block in you theme like that:
vendor/theme/Magento_Theme/Block/Html/Topmenu.php
You can override core block using di,xml.
for more info you can visit following link.
overriding-rewriting-classes-magento2/
I hope it will help you!