Shopify themes, liquid, logos, and UX
Hello there,
I have made some changes to have my title and star rating appear before the image on mobile only, it works well on desktop as everything stays the same however, on mobile the star ratings are showing twice and I would like to hide the one showing at the bottom as I would like to have the star rating just below the title on mobile without affecting the desktop view.
Here is a link to one of my product pages, you can see the star ratings are appearing twice on mobile, I would like to hide the bottom one.
Thank you in advance for your time and help.
Kind regards,
Follow these steps:
1. Go to Online Store -> Theme -> Edit code
2. Open your base.css file and paste the following code at the bottom:
@media only screen and (max-width: 767px) {
.desktop-rating-stars {
display: none !important;
}
}
Hello, Thank you for your prompt answers.
Unfortunately, I have tried these three different codes and it still doesn't work, I am not sure why.
For more context, please find below screenshots of my product.liquid codes the first screenshot shows the liquid code that renders the stars above the image on mobile. And the second screenshot shows the code that should only render the stars on desktop.
Additionally, here is a screenshot of my CSS codes added to base.css:
Thank you again for everyone's precious time and help.
Kind regards
I've finally figured it out, I used some HTML directly in the product.liquid file as follow:
<style>
/* Hide the desktop-rating-stars element on screens narrower than 750px (mobile) */
@media screen and (max-width: 749px) {
.desktop-rating-stars {
display: none !important;
}
}
Just above this code:
<div class="desktop-rating-stars">
{% for block in section.blocks %}
{% case block.type %}
{% when 'rating_stars' %}
{% render 'rating-stars-block', block: block, margins: true, block_attributes: true %}
{% endcase %}
{% endfor %}
</div>
Which finally worked.
Thank you everyone for your help and contribution!
1. Go to 'Online Store' -> Themes
2. From your active theme click on the 3 dots (...) -> Edit Code
3. Inside the assets folder, locate the file 'base.css'
4. At the bottom of the file add
@media (max-width: 749px){
.desktop-rating-stars{
display: none;
}
}
this code
- Here is the solution for you @aestheticanvas
- Please follow these steps:
- Then find the base.css file.
- Then add the following code at the end of the file and press 'Save' to save it.
@media (max-width: 749px){
.desktop-rating-stars{
display: none !important;
}
}
- Here is the result you will achieve:
- Please press 'Like' and mark it as 'Solution' if you find it helpful. Thank you.
If our suggestions are useful, please let us know by giving it a like or marking it as a solution.
Salepify: Efficiently increase sales conversion with sale-driven features like auto add to cart, free gifts (free plan available)
Salemate: Boost your AVO with 2-layer offer, countdown upsell in your post purchase page
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025