Hi, I want my store (https://gemdrives.co.il) to show the blog posts in the homepage just the way it is now, but on mobile, to show only one featured blog post, and a button for more articles.
I know I can hire a Shopify expert, but I am trying to do it by myself, I have a little background in coding.
So in my featured-blog file, I was trying to replace
<ul class="grid grid--uniform grid--blog">
{% for article in blog.articles limit: section.settings.post_limit %}
<li class="grid__item medium-up--one-third">
... and on and on
with
<ul class="grid grid--uniform grid--blog">
<script>
var isMobile = navigator.userAgent.match(/(iPhone|iPod|iPad|Android|webOS|BlackBerry|IEMobile|Opera Mini)/i);
if(isMobile){
{% for article in blog.articles limit: 1 %}
}else{
{% for article in blog.articles limit: section.settings.post_limit %}
}
</script>
<li class="grid__item medium-up--one-third">
... and on and on
and it isn't working, I guess I implemented the idea the wrong way, and also, this code doesn't provide the button for all of the blog posts, but I guess i will be able to add it easily once I understand the idea.
Would appreciate any help. Thank you, Ishay.
User | Count |
---|---|
23 | |
20 | |
18 | |
16 | |
16 |