Hello,
I want to call homepost.phtml file in front page,
My file is located in app/code/FishPig/WordPress/view/frontend/templets/sidebar/widget/homepost.phtml.
I write code in this file to call 5 recent post. But I don't know how to call this file or display this on front page of my website?
I am trying to call it by below given code but its not display anything
{{block class="FishPig\WordPress\Block\Post" template="FishPig_WordPress::sidebar/homepost.phtml"}}
Please help me.
Solved! Go to Solution.
You missed the widget folder inside your template declaration, New path will be
FishPig_WordPress::sidebar/widget/homepost.phtml
instead of
FishPig_WordPress::sidebar/homepost.phtml
Now final declaration will be,
{{block class="FishPig\WordPress\Block\Post" template="FishPig_WordPress::sidebar/widget/homepost.phtml"}}
Clear cache and check.
You missed the widget folder inside your template declaration, New path will be
FishPig_WordPress::sidebar/widget/homepost.phtml
instead of
FishPig_WordPress::sidebar/homepost.phtml
Now final declaration will be,
{{block class="FishPig\WordPress\Block\Post" template="FishPig_WordPress::sidebar/widget/homepost.phtml"}}
Clear cache and check.