How do I edit a category page in a Blogger template to display product cards?

Category pages play a key role in the structure of a blog. If you want to improve their appearance, add product cards, and optimize them for SEO, fast loading, and mobile devices, this article will help you understand all aspects of editing a Blogger template. 🌟

    How do I edit the category page in my Blogger product card template? foto

    Why edit the categories page?

    Editing the category page allows you to:

    • Make the blog visually appealing.

    • Improve the user experience.

    • Increase the likelihood of conversions (for example, clicks on product cards).

    • Improve SEO by increasing the visibility of the category in search engines.

    • Adapt the page for mobile devices for the convenience of users. 📱

    How does the category page work in Blogger?

    On the Blogger platform, category pages are automatically generated based on the labels assigned to posts. However, the design and functionality of such pages is limited by the blog template. To change their appearance, you need to edit the HTML and CSS codes of the template.

    What are the steps required to edit the category page? 🚀

    Follow the instructions to edit the category page and add product cards:

    Step 1. Find the HTML Category Page Template

    1. Go to "Theme" → "Edit HTML".

    2. Find the section responsible for displaying categories. This is usually a block with a b:loop loop.

      <b:if cond='data:post.labels'>
        <b:loop values='data:post.labels' var='label'>
          <a expr:href='data:label.url'><data:label.name/></a>
        </b:loop>
      </b:if>

    Step 2. Add HTML for product cards

    Change the standard output of posts to product cards. For example:

    <div class="category-products">
      <b:loop values='data:posts' var='post'>
        <div class="product-card">
          <a expr:href='data:post.url'>
            <img expr:src='data:post.featuredImage' alt='data:post.title'/>
          </a>
          <h3><data:post.title/></h3>
          <p><data:post.snippet/></p>
        </div>
      </b:loop>
    </div>

    Step 3. Enhance the look and feel with CSS

    Add the following CSS to your template to style the cards:

    <style>
      .category-products {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
        padding: 20px;
        background-color: #f9f9f9;
      }
    
      .product-card {
        width: 250px;
        border: 1px solid #ddd;
        border-radius: 8px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        text-align: center;
        padding: 10px;
        background-color: #fff;
      }
    
      .product-card img {
        width: 100%;
        height: 150px;
        object-fit: cover;
        border-radius: 5px;
      }
    
      .product-card h3 {
        font-size: 18px;
        margin: 10px 0;
      }
    
      .product-card p {
        font-size: 14px;
        color: #666;
      }
    </style>

    Step 4. Set up a link for a category

    To display cards only for a specific category, use the b:if condition:

    <b:if cond='data:post.labels any (l => l.name == "Electronics")'>
      <!-- Product card -->
    </b:if>

    How to optimize a page for SEO? 🔍

    1. Add a unique page description:

      <meta name="description" content="All products in the category 'Electronics': the best offers and descriptions.">
    2. Use structured data (JSON-LD):

      <script type="application/ld+json">
      {
        "@context": "https://schema.org",
        "@type": "ItemList",
        "itemListElement": [
          {
            "@type": "ListItem",
            "position": 1,
            "name": "Product 1",
            "url": "https://example.com/product1"
          },
          {
            "@type": "ListItem",
            "position": 2,
            "name": "Product 2",
            "url": "https://example.com/product2"
          }
        ]
      }
      </script>
    3. Use keywords in titles and alt attributes for images.

    How do I make my category page load faster? ⚡

    To optimize speed, follow these steps:

    1. Minify CSS and JavaScript: Use online tools to shorten your code.

    2. Optimize images: Upload compressed images without losing quality. Use WebP formats.

    3. Enable browser caching: Configure caching through the server settings or use Blogger's built-in features.

    How to adapt a page for mobile devices? 📱

    Add media queries for cards:

    @media (max-width: 768px) {
      .product-card {
        width: 100%;
      }
    }
    

    Don't forget to include the zoom meta tag as well:

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    How do I check the work of the page? ✅

    1. Open the page on different devices (desktop, tablet, smartphone).

    2. Check your loading speed with Google PageSpeed Insights.

    3. Make sure that the product cards are displayed correctly.

    Editing the category page in a Blogger template is a useful skill that allows you to make your blog more attractive and user-friendly. Focus on optimization, fast loading, and mobile adaptation to achieve great results. 🌟

    Three simple tests on this topic

    1. Why edit the categories page? Check the unnecessary:








    2. How to improve the appearance of product cards? Choose the right answer:








    3. How to adapt a page for mobile devices? Choose the right answer:







    Improve your karma with successful decisions !!

    Share & rate

    How do I edit a category page in a Blogger template to display product cards?
    4 stars - based on 5 reviews
    Loading... / Loading...

    Similar topics