How to change the width of a custom page in dawn theme

Solved

How to change the width of a custom page in dawn theme

mysticgleam
Tourist
4 0 3

Hello guys,

I am making a custom page but i am not able to find any solutions on how to change the width of custom page. I want to add 4 products or 5 products in one row but unable to do so cause of page width.  https://mysticgleam.com/pages/crystal-encyclopedia

mysticgleam_0-1726237915303.png

 

Accepted Solution (1)
BSS-TekLabs
Shopify Partner
2350 701 826

This is an accepted solution.

{% if request.path == '/pages/crystal-encyclopedia' %}
  <style>
.page-width--narrow {
        max-width: 100% !important;
    }
</style>
{% endif %}

Can you try this code @mysticgleam 

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


BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

View solution in original post

Replies 8 (8)

BSS-TekLabs
Shopify Partner
2350 701 826

- Here is the solution for you @mysticgleam 
- Please follow these steps:
1. Go to Online Store --> Theme --> Edit code.
2. Open your theme.liquid file
3. In theme.liquid, paste the below code before </head> and press 'Save' to save it

<style>
.page-width--narrow {
        max-width: 100% !important;
    }
</style>

- Here is the result you will achieve:

BSSTekLabs_0-1726238261985.png

 

- 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


BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now
mysticgleam
Tourist
4 0 3

I just want to change one page, apply this code change the width of all pages on my site.

BSS-TekLabs
Shopify Partner
2350 701 826

This is an accepted solution.

{% if request.path == '/pages/crystal-encyclopedia' %}
  <style>
.page-width--narrow {
        max-width: 100% !important;
    }
</style>
{% endif %}

Can you try this code @mysticgleam 

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


BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

BSSCommerce-B2B
Shopify Partner
1718 512 575

@mysticgleam ,

Step 1: Go to Shopify Admin -> Online Store ->Theme -> Edit code

Step 2: Search file theme.liquid

Step 3: Insert this code above </head> tag:

 

<style>
   #shopify-section-template--20699973353760__main .page-width--narrow {
        max-width: 100%!important;
   }
   .section-template--20699973353760__main-padding .main-page-title {
       padding: 0 20px!important;
   }
</style>

 

Result

BSSCommerceB2B_0-1726238621540.png

If it helps you, please like and mark it as the solution.

Best Regards 😍

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

mysticgleam
Tourist
4 0 3

This code is not working

BSSCommerce-B2B
Shopify Partner
1718 512 575

Could you show me the code you added to your theme.liquid file? Or you could try adding it to above </body> tag like this 

BSSCommerceB2B_0-1726289961152.png

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

Tech_Coding
Shopify Partner
301 76 67

Hello @mysticgleam 

You can add code by following these steps

1. Go to Online Store -> Theme -> Edit code.
2. Open your theme.liquid file

3. Paste the below code before </body> on theme.liquid
<style>
section#shopify-section-template--20699973353760__main .page-width.page-width--narrow {
max-width: 100% !important;
}
</style>

Tech_Coding_0-1726238306956.png

my reply helpful? Click Like to let me know!
your question answered? Mark it as an Accepted Solution.

my reply helpful? Click Like to let me know!
your question answered? Mark it as an Accepted Solution.
Shopify UI Developer
Your Coffee Tips adds a little sweetness to my day.

olive57
Shopify Partner
2 0 0

Here is the solution

 

To change the width of your custom page and fit 4-5 products per row, try setting a custom CSS rule. You can adjust the container width and set a flexible grid for your products:

```css
.custom-page {
width: 100%; /* or a specific width */
max-width: 1200px; /* adjust as needed */
margin: 0 auto; /* center the content */
}

.product-grid {
display: grid;
grid-template-columns: repeat(4, 1fr); /* Change 4 to 5 for five products */
gap: 20px; /* Adjust gap between products */
}
```

Make sure your container element uses the `.custom-page` class, and the products are inside a `.product-grid` wrapper. Adjust values to fit your design.