Shopify themes, liquid, logos, and UX
Hi there!
We have a blog in our site with several articles. We wish to show the articles in that blog but not have a link to see all the articles under the blog (when visiting url/blog-handle). Is there a way to achieve this?
I am aware that we can just not show the blog link under navigation but we don't wish for users to visit the blog handle link and see all those articles.
can you please share store url so i will check and guide
Hi @faizan_abid,
Please follow these steps:
- Step 1: Go to Online store > Themes > Actions > Edit code.
- Step 2: Go to Templates > blog.liquid and remove all code: https://i.imgur.com/rcedomC.png
- Step 3: Add code: https://i.imgur.com/gvZulyQ.png
<script type="text/javascript">
window.location.href= '{{ routes.root_url }}';
</script>
Then when go to the blog page, it will automatically return the home page.
If you are only setting for a single blog, you can change the code: https://i.imgur.com/vqXpkAA.png
{% if blog.handle == 'blog-handle' %}
<script type="text/javascript">
window.location.href= '{{ routes.root_url }}';
</script>
{% else %}
{% section 'blog-template' %}
{% endif %}
Hope it is clear to you.
If my answer can help you solve your issue, please kindly mark it as a solution. Thank you and good luck.
Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025Expand into selling wholesale with Shopify Academy’s learning path, B2B on Shopify: Lau...
By Shopify Jan 28, 2025