Using Shopify and Single's membership features, you can grant your members special access to specific blog posts or an entire blog in your online store.
Before you start
This process is designed to gate a Shopify blog, so make sure you have that set up first. Here's how you can add a blog to your online store. Additionally, we strongly suggest backing up your current theme to avoid any issues that might occur during the modification process.
- Log into your Shopify admin.
- Go to Online Store > Themes.
- Click on Actions, then choose Edit Code.
- On the left sidebar, locate and open the main-blog.liquid file.
- Insert the following code right above the first <div>
statement along with the conditional content that should display for non-members.
- Add below your conditional content to close the if-else statement.
Note: Once you've edited and saved the ' main-blog.liquid ' file, Shopify will automatically update your live theme. It's a good idea to preview the changes first to ensure everything is working as expected.