how to make these div blocks on same line? - html

My newsletters does not want to be on the same line as the other three blocks, it goes on a second line under the blogpost. Can someone tell me how to fix this in a very noob friendly term i am not good at programming.
<div class="footer-wrapper">
<footer>
<div class="row">
<div class="span12 full-border"></div>
<!-- Begin latest blog post -->
{% if settings.footer_blog_post and blogs[settings.footer_blog_post].handle == settings.footer_blog_post and blogs[settings.footer_blog_post].articles.size > 0 %}
{% assign article = blogs[settings.footer_blog_post].articles.first %}
<div class="span4">
<div class="p30">
<h4>{{ settings.footer_blog_post_header }}</h4>
<p class="p10"><strong>{{ article.title | link_to: article.url }}</strong></p>
<p>{{ article.content | strip_html | truncatewords: 30 }}</p>
</div>
</div>
{% endif %}
<!-- End latest blog post -->
<!-- Begin footer navigation -->
<div class="span4 footer-menu">
<h4>{{ settings.footer_linklist_title }}</h4>
<ul class="unstyled">
{% for link in linklists[settings.footer_linklist].links %}
<li>{{ link.title }}</li>
{% endfor %}
</ul>
</div>
<!-- End footer navigation -->
<!-- Begin newsletter/social -->
<div class="clearfix">
{% if settings.enable_social_links %}
<h4>{{ settings.footer_social_title }}</h4>
{% if settings.twitter_link != '' %}Twitter{% endif %}
{% if settings.facebook_link != '' %}Facebook{% endif %}
{% if settings.youtube_link != '' %}YouTube{% endif %}
{% if settings.atom_link != '' %}Blog feed{% endif %}
{% if settings.instagram_link != '' %}Instagram{% endif %}
{% if settings.pinterest_link != '' %}Pinterest{% endif %}
{% if settings.vimeo_link != '' %}Vimeo{% endif %}
{% if settings.tumblr_link != '' %}Tumblr{% endif %}
{% if settings.google_link != '' %}Google+{% endif %}
{% endif %}
</div>
<div class="span4">
{% if settings.footer_display_newsletter %}
<div class="p30">
<h4>{{ settings.footer_newsletter_title }}</h4>
<form action="{{ settings.mailing_list_form_action }}" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" target="_blank">
<input type="email" value="" placeholder="Email Address" name="EMAIL" id="mail" /><input type="submit" class="btn newsletter" value="Subscribe" name="subscribe" id="subscribe" />
</form>
</div>
{% endif %}
</div>
</div>
<!-- End newsletter/social -->
<!-- Begin copyright -->
<div class="span12 tc copyright">
<p>Copyright © {{ 'now' | date: "%Y" }} {{ shop.name }} <!--| {{ powered_by_link }}--> {% if settings.designed_by %}{% endif %} </p>
<ul class="credit-cards clearfix">
{% if settings.accept_visa %}<li><img src="{{ 'icon-cc-visa.gif' | asset_url }}" alt="Visa" /></li>{% endif %}
{% if settings.accept_mastercard %}<li><img src="{{ 'icon-cc-mastercard.gif' | asset_url }}" alt="MasterCard" /></li>{% endif %}
{% if settings.accept_amex %}<li><img src="{{ 'icon-cc-amex.gif' | asset_url }}" alt="Amex" /></li>{% endif %}
{% if settings.accept_cirrus %}<li><img src="{{ 'icon-cc-cirrus.gif' | asset_url }}" alt="Cirrus" /></li>{% endif %}
{% if settings.accept_delta %}<li><img src="{{ 'icon-cc-delta.gif' | asset_url }}" alt="Delta" /></li>{% endif %}
{% if settings.accept_discover %}<li><img src="{{ 'icon-cc-discover.gif' | asset_url }}" alt="Discover" /></li>{% endif %}
{% if settings.accept_westernunion %}<li><img src="{{ 'icon-cc-westernunion.gif' | asset_url }}" alt="Western Union" /></li>{% endif %}
{% if settings.accept_paypal %}<li><img src="{{ 'icon-cc-paypal.gif' | asset_url }}" alt="PayPal" /></li>{% endif %}
{% if settings.accept_bitcoin %}<li><img src="{{ 'icon-cc-bitcoin.gif' | asset_url }}" alt="Bitcoin" /></li>{% endif %}
</ul> <!-- /.credit-cards -->
</div>
<!-- End copyright -->
</div>
</footer>

apply this for all div style :
{display:inline;
float:left;}

Related

Building a dropdown filter

I was wondering if I can have assistance with building a dropdown filter for classes. I was looking at this example: https://codepen.io/luciopaiva/pen/YXYGYE?editors=101 but the difference is that I am using Twig from Advanced Custom Fields Plugin so I cannot manually input the data into the HTML. Here is the HTML I am using. I am trying to make it like this photo. See image here I don't have styling, but this is the logic I am trying to achieve. Basically I am trying to build a relative filter based on what the visitor clicks and have the correct box show below relative to the course. PLEASE HELP!! Thank you!
HTML:
<div class="course-selections filter-section without-background no-left-right">
<div class="customlayout">
{% set category = bloc.training_course_list_compact %}
<h2 class="center-title">{{ category.headline }}</h2>
<div class="inner-class-selection filter-inner-section">
<div class="filter-courses filter-area">
<div class="filter" id="course-solution">
<div class="upper-filter"><h3>Solutions</h3><i class="fas fa-angle-down"></i></div>
<div class="filter-dropdown">
{% for category in bloc.training_course_list_compact.course_categories %}
{% set titleupper = category.title %}
<h4>{{ titleupper|e('wp_kses_post') }}</h4>
{% endfor %}
</div>
</div>
<div class="filter" id="course-type">
<div class="upper-filter"><h3>Class Format</h3><i class="fas fa-angle-down"></i></div>
<div class="filter-dropdown">
{% for category in bloc.training_course_list_compact.course_categories %}
{% for course in category.get_field('courses') %}
{% for classformats in course.get_field('dates') %}
{% set classformat = classformats.class_format %}
{% if classformat == "Lecture" %}
<div class="class-types type-filter lecture"></div>
{% elseif classformat == "Online" %}
<div class="class-types type-filter online"></div>
{% endif %}
{% endfor %}
{% endfor %}
{% endfor %}
<div class="class-title-type type-filter lecture-type"><h4></h4><span></span>
</div>
<div class="class-title-type type-filter online-type"><h4></h4><span></span>
</div>
</div>
</div>
<div class="filter" id="course-location">
<div class="upper-filter"><h3>Locations</h3><i class="fas fa-angle-down"></i></div>
<div class="filter-dropdown">
{% for category in bloc.training_course_list_compact.course_categories %}
{% for locationcourse in category.get_field('courses') %}
{% for location in locationcourse.get_field('dates') %}
<div class="course-location" data-value="{{ location.location }}"></div>
{% endfor %}
{% endfor %}
{% endfor %}
<div class="class-location type-filter"></div>
</div>
</div>
<div class="filter" id="course-date">
<div class="upper-filter"><h3>Start Date</h3><i class="fas fa-angle-down"></i></div>
<div class="filter-dropdown">
{% for category in bloc.training_course_list_compact.course_categories %}
{% for datecourse in category.get_field('courses') %}
{% for dates in datecourse.get_field('dates') %}
<div class="course-date" data-value="{{ dates.date }}"></div>
{% endfor %}
{% endfor %}
{% endfor %}
<div class="class-date type-filter"></div>
</div>
</div>
</div>
<div class="class-blocks">
{% for category in bloc.training_course_list_compact.course_categories %}
{% set thumbnail = category.thumbnail %}
{% set link = category.link %}
{% set titleupper = category.title %}
{% for course in category.get_field('courses') %}
{% set link = course.link %}
{% set title = course.title %}
<div class="class-block">
<a class="class-block-link" href="{{ link|e('esc_url') }}">
<div class="image">
</div>
<h3>{{ title|e('wp_kses_post') }}</h3>
<h4>{{ titleupper|e('wp_kses_post') }}</h4>
</a>
<a class="course-link" href="{{ link|e('esc_url') }}">Course</a>
</div>
{% endfor %}
{% endfor %}
</div>
</div>
</div>

How to place review section in different position for Mobile and Desktop in Shopify?

I have this product-template.liquid file:
<div itemscope itemtype="http://schema.org/Product" id="ProductSection" data-section-id="{{ section.id }}" data-section-type="product-template" data-image-zoom-type="{{ section.settings.product_image_zoom_type }}" data-related-enabled="{{ section.settings.product_related_enable }}" data-show-extra-tab="{{ section.settings.show_extra_tab }}" data-extra-tab-content="{{ section.settings.extra_tab_content }}" data-enable-history-state="true">
{% case section.settings.add_to_cart_width %}
{% when 'small' %}
{%- assign btn_class = 'btn--wide' -%}
{%- assign productform_class = 'product-form--wide' -%}
{% when 'medium' %}
{%- assign btn_class = 'btn--wide' -%}
{%- assign productform_class = 'product-form--wide' -%}
{% when 'large' %}
{%- assign btn_class = 'btn--full' -%}
{%- assign productform_class = 'product-form--full' -%}
{% endcase %}
{% if section.settings.add_to_cart_width != 'small' %}
<style>
#media screen and (min-width: 769px){
.single-option-selector,
.quantity-selector {
{% if section.settings.add_to_cart_width == 'medium' %}
min-width: 50%;
{% else %}
min-width: 100%;
{% endif %}
}
}
</style>
{% endif %}
<meta itemprop="url" content="{{ shop.url }}{{ product.url }}">
<meta itemprop="image" content="{{ product.featured_image.src | img_url: 'grande' }}">
<div class="section-header section-header--breadcrumb">
{% include 'breadcrumb' %}
</div>
<div class="product-single">
<div class="grid product-single__hero">
<div class="grid__item post-large--one-half">
{% if section.settings.product_thumbnails_position == 'below' or product.images.size < 2 %}
<div class="product-single__photos">
{% assign featured_image = product.selected_or_first_available_variant.featured_image | default: product.featured_image %}
{% for image in product.images %}
{% capture img_id %}ProductImage-{{ image.id }}{% endcapture %}
{% capture img_wrapper_id %}ProductImageWrapper-{{ image.id }}{% endcapture %}
{%- assign img_url = image | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}
{% include 'image-style' with image: image, small_style: false, width: 700, height: 1024, wrapper_id: img_wrapper_id, img_id: img_id %}
<div id="{{ img_wrapper_id }}" class="product-single__image-wrapper supports-js{% unless featured_image == image %} hide{% endunless %}{% if section.settings.product_image_zoom_type == 'lightbox' %} zoom-lightbox{% endif %}" data-image-id="{{ image.id }}">
<div style="padding-top:{{ 1 | divided_by: image.aspect_ratio | times: 100}}%;">
<img id="{{ img_id }}"
class="product-single__image lazyload{% unless featured_image == image %} lazypreload{% endunless %}"
{% if featured_image == image %}src="{{ image | img_url: '300x300' }}"{% endif %}
data-src="{{ img_url }}"
data-widths="[180, 370, 540, 740, 900, 1080, 1296, 1512, 1728, 2048]"
data-aspectratio="{{ image.aspect_ratio }}"
data-sizes="auto"
{% if section.settings.product_image_zoom_type == 'zoom-in' %} data-zoom="{{ image | img_url: '1024x1024', scale: 2 }}"{% endif %}
alt="{{ image.alt | escape }}">
</div>
</div>
{% endfor %}
<noscript>
<img src="{{ featured_image | img_url: '1024x1024', scale: 2 }}" alt="{{ featured_image.alt | escape }}">
</noscript>
</div>
{% if product.images.size > 1 %}
<ul class="product-single__thumbnails grid-uniform" id="ProductThumbs">
{% for image in product.images %}
<li class="grid__item wide--one-quarter large--one-third medium-down--one-third">
<a data-image-id="{{ image.id }}" href="{{ image.src | img_url: '1024x1024' }}" class="product-single__thumbnail">
<img src="{{ image.src | img_url: 'grande' }}" alt="{{ image.alt | escape }}">
</a>
</li>
{% endfor %}
</ul>
{% endif %}
{% else %}
<div class="grid">
<div class="grid__item four-fifths product-single__photos" id="ProductPhoto">
{% assign featured_image = product.selected_or_first_available_variant.featured_image | default: product.featured_image %}
{% for image in product.images %}
{% capture img_id %}ProductImage-{{ image.id }}{% endcapture %}
{% capture img_wrapper_id %}ProductImageWrapper-{{ image.id }}{% endcapture %}
{%- assign img_url = image | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}
{% include 'image-style' with image: image, small_style: false, width: 700, height: 1024, wrapper_id: img_wrapper_id, img_id: img_id %}
<div id="{{ img_wrapper_id }}" class="product-single__image-wrapper supports-js{% unless featured_image == image %} hide{% endunless %}{% if section.settings.product_image_zoom_type == 'lightbox' %} zoom-lightbox{% endif %}" data-image-id="{{ image.id }}">
<div style="padding-top:{{ 1 | divided_by: image.aspect_ratio | times: 100}}%;">
<img id="{{ img_id }}"
class="product-single__image lazyload{% unless featured_image == image %} lazypreload{% endunless %}"
{% if featured_image == image %}src="{{ image | img_url: '300x300' }}"{% endif %}
data-src="{{ img_url }}"
data-widths="[180, 370, 540, 740, 900, 1080, 1296, 1512, 1728, 2048]"
data-aspectratio="{{ image.aspect_ratio }}"
data-sizes="auto"
{% if section.settings.product_image_zoom_type == 'zoom-in' %} data-zoom="{{ image | img_url: '1024x1024', scale: 2 }}"{% endif %}
alt="{{ image.alt | escape }}">
</div>
</div>
{% else %}
<img src="{{ featured_image | img_url: '1024x1024', scale: 2 }}" alt="{{ featured_image.alt | escape }}">
{% endfor %}
<noscript>
<img src="{{ featured_image | img_url: '1024x1024', scale: 2 }}" alt="{{ featured_image.alt | escape }}">
</noscript>
</div>
<div class="grid__item one-fifth">
<ul class="grid product-single__thumbnails" id="ProductThumbs">
{% for image in product.images %}
<li class="grid__item">
<a data-image-id="{{ image.id }}" href="{{ image.src | img_url: '1024x1024' }}" class="product-single__thumbnail">
<img src="{{ image.src | img_url: 'grande' }}" alt="{{ image.alt | escape }}">
</a>
</li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
{% if section.settings.product_image_zoom_type == 'lightbox' %}
<ul class="gallery" class="hidden">
{% for image in product.images %}
<li data-image-id="{{ image.id }}" class="gallery__item" data-mfp-src="{{ image | img_url: '1024x1024', scale: 2 }}"></li>
{% endfor %}
</ul>
{% endif %}
</div>
<div class="grid__item post-large--one-half">
{% if section.settings.product_vendor_enable %}
<span class="h3" itemprop="brand">{{ product.vendor }}</span>
{% endif %}
<h1 itemprop="name">{{ product.title }}</h1>
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
{% assign variant = product.selected_or_first_available_variant %}
<meta itemprop="priceCurrency" content="{{ shop.currency }}">
<link itemprop="availability" href="http://schema.org/{% if product.available %}InStock{% else %}OutOfStock{% endif %}">
<div class="product-single__prices{% if shop.taxes_included or shop.shipping_policy.body != blank %} product-single__prices--policy-enabled{% endif %}">
<span id="PriceA11y" class="visually-hidden">{{ 'products.product.regular_price' | t }}</span>
<span id="ProductPrice" class="product-single__price" itemprop="price" content="{{ product.price | divided_by: 100.00 }}">
{{ product.price | money }}
</span>
{% if product.compare_at_price > product.price %}
<span id="ComparePriceA11y" class="visually-hidden" aria-hidden="false">{{ 'products.product.sale_price' | t }}</span>
<s id="ComparePrice" class="product-single__sale-price">
{{ product.compare_at_price_max | money }}
</s>
{% else %}
<span id="ComparePriceA11y" class="visually-hidden" aria-hidden="true">{{ 'products.product.sale_price' | t }}</span>
<s id="ComparePrice" class="product-single__sale-price hide">
{{ product.compare_at_price_max | money }}
</s>
{% endif %}
</div>
{%- if shop.taxes_included or shop.shipping_policy.body != blank -%}
<div class="product-single__policies{% if product.has_only_default_variant and section.settings.product_quantity_enable == false %} product__policies--no-dropdowns{% endif %} rte">
{%- if shop.taxes_included -%}
{{ 'products.general.include_taxes' | t }}
{%- endif -%}
{%- if shop.shipping_policy.body != blank -%}
{{ 'products.general.shipping_policy_html' | t: link: shop.shipping_policy.url }}
{%- endif -%}
</div>
{%- endif -%}
{% form 'product', product, class:productform_class %}
<select name="id" id="ProductSelect-{{ section.id }}" class="product-single__variants">
{% for variant in product.variants %}
{% if variant.available %}
<option {% if variant == product.selected_or_first_available_variant %} selected="selected" {% endif %} data-sku="{{ variant.sku }}" value="{{ variant.id }}">{{ variant.title }} - {{ variant.price | money_with_currency }}</option>
{% else %}
<option disabled="disabled">
{{ variant.title }} - {{ 'products.product.sold_out' | t }}
</option>
{% endif %}
{% endfor %}
</select>
<div class="product-single__quantity{% unless section.settings.product_quantity_enable %} is-hidden{% endunless %}">
<label for="Quantity">{{ 'products.product.quantity' | t }}</label>
<input type="number" id="Quantity" name="quantity" value="1" min="1" class="quantity-selector">
</div>
<button type="submit" name="add" id="AddToCart" class="btn {{ btn_class }}{% if section.settings.enable_payment_button %} btn--secondary{% endif %}">
<span id="AddToCartText">{{ 'products.product.add_to_cart' | t }}</span>
</button>
{% if section.settings.enable_payment_button %}
{{ form | payment_button }}
{% endif %}
{% endform %}
{% unless section.settings.show_extra_tab == false or pages[section.settings.extra_tab_content] == empty %}
<div class="tabs">
<ul class="tab-switch__nav">
<li>
{{ 'products.product.description' | t }}
</li>
<li>
{{ pages[section.settings.extra_tab_content].title }}
</li>
</ul>
<div id="description" class="tab-switch__content" data-content="description">
<div class="product-description rte" itemprop="description">
{{ product.description }}
</div>
</div>
<div id="extra" class="tab-switch__content" data-content="extra">
<div class="rte">
{{ pages[section.settings.extra_tab_content].content }}
</div>
</div>
</div>
{% else %}
<div class="product-description rte" itemprop="description">
{{ product.description }}
</div>
{% endunless %}
<div id="shopify-product-reviews" data-id="{{product.id}}">{{ product.metafields.spr.reviews }}</div>
{% if section.settings.social_sharing %}
<hr class="hr--clear hr--small">
<h2 class="h4">{{ 'products.general.share_title' | t }}</h2>
{% include 'social-sharing' %}
{% endif %}
</div>
</div>
</div>
</div>
{% if section.settings.product_related_enable %}
{% include 'related-products' %}
{% endif %}
</div>
{% unless product == empty %}
<script type="application/json" id="ProductJson-{{ section.id }}">
{{ product | json }}
</script>
{% endunless %}
How can i achieve this reviews section location different for mobile and desktop. I want reviews section below big image in desktop and in mobile version i want it below specification section.
I tried adding it below product description section but in mobile version it is now showing under product image which i don't want. I want it to show under product specification in mobile .... so there is a conflict. How can i have separate little tweak for different version ?
How can i do it?
It's simple CSS hack, you just need to use two different div for desktop and mobile. You can hide one div on Mobile(use CSS class: small--hide) and hide other on desktop (use CSS class: medium-up--hide).
Reference code for Debut Theme
<div class="grid__item medium-up--one-half small--hide">
<!-- Content to be shown on Desktop -->
</div>
<div class="mobile-nav-wrapper medium-up--hide">
<!-- Content to be shown on Mobile -->
</div>
add 2 divs one for mobile and one for desktop use visibility likewise if in desktop hide mobile div and in mobile div hide desktop div.
You have to put code inside 2 divs for show widget given by review app you are using on your store.
If any help i am available to help you.
I have created 150+ stores on shopify and still creating more.
{% comment %} Div below is for Desktop Content {% endcomment %}
<div class="grid__item small--hide">
Insert whatever content you want to show on Tablet/Desktop here
</div>
{% comment %} Div below is for Moblie Content {% endcomment %}
<div class="grid__item medium-up--hide">
Insert whatever content you want to show on Mobile here
</div>

How to display 24 items in a carousel - Jekyll

Im working in a project and currently I have a data file that display 24 clients in a page that im taking for a data file
{% for client in site.data.clients %}
<li>
<a href="{{client.URL}}" target="_blank">
<img src="{% asset_path {{client.image}} %}"
alt="{{ client.alt }}">
</a>
</li>
{% endfor %}
I would like to implement a carousel that display 12 items in one slide (and when clicked the arrow) display the other 12 items.
"Two slides with 12 elements each"
I've tried to implement that in the owl carousel but somehow is inserting me all the items in the first element of the first slide. still trying to find a way to split all the elements in two slides like the picture.
what i have implemented so far:
<div class="testi-service owl-carousel owl-theme ">
{% for client in site.data.clients %}
{% if forloop.index > 24 %}
{% assign slidenum = 2 %}
{% else %}
{% assign slidenum = 1 %}
{% endif %}
<div class="owl-item">
<div class="oc-item slide{{ slidenum }}">
<a href="{{client.URL}}" target="_blank">
<img src="{% asset_path {{client.image}} %}" alt="{{ client.alt }}">
</a>
</div>
</div>
{% endfor %}
</div>
</div>
This can be achieved with the following Liquid:
{% for client in site.data.clients %}
{% if forloop.index > 12 %}
{% assign slidenum = 2 %}
{% else %}
{% assign slidenum = 1 %}
{% endif %}
<li class="slide{{ slidenum }}">
<a href="{{client.URL}}" target="_blank">
<img src="{% asset_path {{client.image}} %}" alt="{{ client.alt }}">
</a>
</li>
{% endfor %}
And this css:
.slide2 {display:none;}
You can control the carousel with the following jQuery:
setInterval(function(){
$("[class^='slide']").toggle();
}, 3000);
Somehow it worked like this. just trying to fix the resizing and responsive problem at the moment
<div class=" col-md-9 clients side padding-content">
<div class="client-carousel">
<div class="container">
<div class="owl-item">
<div class="oc-item">
<ul class="clients-grid grid-6 nobottommargin clearfix">
{% comment %}
`site.data.clients` defined in `_data/clients.yml`
{% endcomment %}
{% for client in site.data.clients %}
{% if forloop.index > 24 %}
{% assign slidenum = 2 %}
{% else %}
{% assign slidenum = 1 %}
{% endif %}
<li class="slide{{ slidenum }}">
<a href="{{client.URL}}" target="_blank">
<img src="{% asset_path {{client.image}} %}" alt="{{ client.alt }}">
</a>
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
<div class="container">
<div class="owl-item">
<div class="oc-item">
<ul class="clients-grid grid-6 nobottommargin clearfix">
{% comment %}
`site.data.clients` defined in `_data/clients.yml`
{% endcomment %}
{% for client in site.data.clients %}
{% if forloop.index > 24 %}
{% assign slidenum = 2 %}
{% else %}
{% assign slidenum = 1 %}
{% endif %}
<li class="slide{{ slidenum }}">
<a href="{{client.URL}}" target="_blank">
<img src="{% asset_path {{client.image}} %}" alt="{{ client.alt }}">
</a>
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
</div>

How can i get elements to stack on top of each other for mobile users without changing the view for desktop users

As you can see in the screenshot, there is an image and then the title, price, options, add to cart button, countdown timer and description to the right. I'm happy with this but when I view this through a mobile browser, it doesn't look too appealing. How can I change my CSS/HTML so each of the elements next to the image are stacked below the image when viewing on a mobile ?
Desktop View:
Desktop View
Mobile View:
Mobile View
HTML:
.photoarea {
float: left;
vertical-align: top;
width: 50%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.detailsarea {
float: left;
width: 50%;
vertical-align: top;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
<div class="grid" itemscope itemtype="http://schema.org/Product">
<meta itemprop="url" content="{{ shop.url }}{{ product.url }}">
<meta itemprop="image" content="{{ product.featured_image.src | img_url: 'grande' }}">
<div class="photoarea">
<div class="grid">
<div class="grid-item large--eleven-twelfths text-center">
<div class="product-photo-container" id="productPhotoContainer-{{ section.id }}">
{% assign featured_image = product.selected_or_first_available_variant.featured_image | default: product.featured_image %}
{% for image in product.images %}
{% capture img_wrapper_id %}productPhotoWrapper-{{ section.id }}-{{ image.id }}{% endcapture %}
{% capture img_id %}productPhotoImg-{{ section.id }}-{{ image.id }}{% endcapture %}
<div class="lazyload__image-wrapper no-js product__image-wrapper{% unless image == featured_image %} hide{% endunless %}" id="{{ img_wrapper_id }}" style="padding-top:{{ 1 | divided_by: image.aspect_ratio | times: 100}}%;" data-image-id="{{ image.id }}">
{%- assign img_url = image | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}
<img id="{{ img_id }}"
{% if forloop.first == true %}
src="{{ featured_image | img_url: '300x300' }}"
{% endif %}
class="lazyload no-js lazypreload"
data-src="{{ img_url }}"
data-widths="[180, 360, 540, 720, 900, 1080, 1296, 1512, 1728, 2048]"
data-aspectratio="{{ image.aspect_ratio }}"
data-sizes="auto"
alt="{{ image.alt | escape }}"
{% if section.settings.product_image_zoom_enable %} data-zoom="{{ image | img_url: '1024x1024', scale: 2 }}"{% endif %}>
</div>
{% if forloop.first == true %}
<noscript>
<img src="{{ image | img_url: '580x' }}"
srcset="{{ image | img_url: '580x' }} 1x, {{ image | img_url: '580x', scale: 2 }} 2x"
alt="{{ image.alt }}" style="opacity:1;">
</noscript>
{% endif %}
{% endfor %}
</div>
<div class="anotherdiv">
{% if product.images.size > 1 %}
<ul class="product-photo-thumbs grid-uniform" id="productThumbs-{{ section.id }}">
{% for image in product.images %}
<li class="grid-item medium-down--one-quarter large--one-quarter">
<a href="{{ image.src | img_url: '1024x1024', scale: 2 }}" class="product-photo-thumb product-photo-thumb-{{ section.id }}" data-image-id="{{ image.id }}">
<img src="{{ image.src | img_url: 'compact' }}" alt="{{ image.alt | escape }}">
</a>
</li>
{% endfor %}
</div>
</ul>
{% endif %}
</div>
</div>
</div>
<div class="detailsarea">
<h1 class="h2" itemprop="name">{{ product.title }}</h1>
{% if section.settings.product_vendor_enable %}
<p class="product-meta" itemprop="brand">{{ product.vendor }}</p>
{% endif %}
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
{% assign variant = product.selected_or_first_available_variant %}
<meta itemprop="priceCurrency" content="{{ shop.currency }}">
<meta itemprop="price" content="{{ variant.price | divided_by: 100.00 }}">
<ul class="inline-list product-meta">
<li>
<span id="productPrice-{{ section.id }}" class="h1">
{% include 'price' with variant.price %}
</span>
</li>
{% if product.compare_at_price_max > product.price and section.settings.product_show_saved_amount %}
<li>
<span id="comparePrice-{{ section.id }}" class="sale-tag large">
{% assign compare_price = variant.compare_at_price %}
{% assign product_price = variant.price %}
{% include 'price-sale' %}
</span>
</li>
{% endif %}
{% if section.settings.product_reviews_enable %}
<li class="product-meta--review">
<span class="shopify-product-reviews-badge" data-id="{{ product.id }}"></span>
</li>
{% endif %}
</ul>
<hr id="variantBreak" class="hr--clear hr--small">
<link itemprop="availability" href="http://schema.org/{% if product.available %}InStock{% else %}OutOfStock{% endif %}">
<form action="/cart/add" method="post" enctype="multipart/form-data" id="addToCartForm-{{ section.id }}">
<select name="id" id="productSelect-{{ section.id }}" class="product-variants product-variants-{{ section.id }}">
{% for variant in product.variants %}
{% if variant.available %}
<option {% if variant == product.selected_or_first_available_variant %} selected="selected" {% endif %} data-sku="{{ variant.sku }}" value="{{ variant.id }}">{{ variant.title }} - {{ variant.price | money_with_currency }}</option>
{% else %}
<option disabled="disabled">
{{ variant.title }} - {{ 'products.product.sold_out' | t }}
</option>
{% endif %}
{% endfor %}
</select>
{% if section.settings.product_quantity_enable %}
<label for="quantity" class="quantity-selector quantity-selector-{{ section.id }}">{{ 'products.product.quantity' | t }}</label>
<input type="number" id="quantity" name="quantity" value="1" min="1" class="quantity-selector">
{% endif %}
<button type="submit" name="add" id="addToCart-{{ section.id }}" class="btn">
<span class="icon icon-cart"></span>
<span id="addToCartText-{{ section.id }}">{{ 'products.product.add_to_cart' | t }}</span>
</button>
{% if section.settings.product_quantity_message%}
<span id="variantQuantity-{{ section.id }}" class="variant-quantity {% if variant.inventory_management and variant.inventory_quantity < 10 and variant.inventory_quantity > 0 %} is-visible{% endif %}">
{% if variant.inventory_management and variant.inventory_quantity < 10 and variant.inventory_quantity > 0 %}
{% assign qty = variant.inventory_quantity %}
{{ 'products.product.only_left' | t: count: qty }}
{% endif %}
</span>
{% endif %}
{% if section.settings.product_incoming_message %}
<span id="variantIncoming-{{ section.id }}" class="variant-quantity {% if variant.inventory_management and variant.inventory_quantity <= 0 and variant.incoming %} is-visible{% endif %}">
{% if variant.inventory_management and variant.inventory_quantity == 0 or variant.inventory_quantity < 0 and current_variant.incoming %}
{% if variant.available %}
{% assign date = variant.next_incoming_date | date: "month_day_year" %}
{{ 'products.product.will_not_ship_until' | t: date: date }}
{% else %}
{% assign date = variant.next_incoming_date | date: "month_day_year" %}
{{ 'products.product.will_be_in_stock_after' | t: date: date }}
{% endif %}
{% endif %}
</span>
{% endif %}
</form>
<hr>
</div>
<div class="lewisdescription">
<div class="product-description rte" itemprop="description">
{{ product.description }}
</div>
</div>
You should use media queries to arrange your elements in a different way for a smaller screens. You do this be changing the css that is applied at different screen sizes.
You'll probably have to do some trial and error to work out how to show your items in the best way for the smaller screen. Here is an example to get you started:
/* Small screens */
#media all and (max-width: 700px) {
.detailsarea, .photoarea {float:none; display:block}
}
Here I've removed the float and added a display block so that detailsarea element will be displayed below the photoarea element on smaller screens.

Jekyll filter categories and posts by tags

In Jekyll I filter posts by tags displating a list of the posts which have the assigned tag like this:
---
layout: layout
---
<ul>
{% for post in site.posts %}
{% for tag in post.tags %}
{% if tag == page.tag %}
<li itemprop="name" itemprop=name>{{ post.title }}</li>
{% endif %}
{% endfor %}
{% endfor %}
</ul>
Burt what I'd like to do is display the categories which have posts of the tag and the posts listed under each category.
Example use case
Category 1 has post 1, post 2, post 3.
Category 2 has post 4, post 5, post 6.
Category 3 has post 7
Posts 1,2,4 have tag Tag1.
The tag page should display Category 1 + Post 1, post 2. Category 2 + Post 4.
On the homepage I display categories with all posts under each category like this:
{% assign counter=0 %}
<main id="page" role="main">
{% for category in site.categories %}
<div class="col pane ui-layout-{% assign counter=counter | plus:1 %}" id="{{ page.id }}">
<div class="colheader">
<div class="bar"></div>
<p class="lead">Leadin text</p>
<h1>{{ category | first }}</h1>
</div>
<div class="colscroll unlock">
{% for posts in category %}
{% for post in posts %}
<div class="colblock" itemscope itemtype="http://schema.org/BlogPosting">
<div class="excerpt">
<time class="date" datetime="{{ page.date | '%Y-%m-%dT%H:%i:%S-08:00' }}" itemprop="datePublished">
{{ page.date | date: '%B %d, %Y' }}
</time>
<h1>
<a itemprop="url" href="{{ post.url }}" target="_blank" title="{{ post.title }}">
<span itemprop="name" itemprop=name>{{ post.title }}</span>
</a>
</h1>
<p itemprop="description">
{{ post.excerpt }}..
</p>
<p class="link_tags">{{ page.tags }}</p>
</div>
</div>
{% endfor %}
{% endfor %}
</div>
</div>
{% endfor %}
</main>
So on the tag page I try to achieve what I want like this but it is returning all categories and all posts just like the homepage rather than filtering by the tag.
---
layout: layout
---
<ul>
{% for post in site.posts %}
{% for tag in post.tags %}
{% if tag == page.tag %}
{% assign counter=0 %}
<main id="page" role="main">
{% for category in site.categories %}
<div class="col pane ui-layout-{% assign counter=counter | plus:1 %}" id="{{ page.id }}">
<div class="colheader">
<div class="bar"></div>
<p class="lead">Leadin text</p>
<h1>{{ category | first }}</h1>
</div>
<div class="colscroll unlock">
{% for posts in category %}
{% for post in post.tags %}
<div class="colblock" itemscope itemtype="http://schema.org/BlogPosting">
<div class="excerpt">
<time class="date" datetime="{{ page.date | '%Y-%m-%dT%H:%i:%S-08:00' }}" itemprop="datePublished">
{{ page.date | date: '%B %d, %Y' }}
</time>
<h1>
<a itemprop="url" href="{{ post.url }}" target="_blank" title="{{ post.title }}">
<span itemprop="name" itemprop=name>{{ post.title }}</span>
</a>
</h1>
<p itemprop="description">
{{ post.excerpt }}..
</p>
<p class="link_tags">{{ page.tags }}</p>
</div>
</div>
{% endfor %}
{% endfor %}
</div>
</div>
{% endfor %}
</main>
{% endif %}
{% endfor %}
{% endfor %}
</ul>
I alsio tried this but it returns a blank page
---
layout: layout
---
<ul>
{% for post in site.posts %}
{% for tag in post.tags %}
{% if tag == page.tag %}
{% assign counter=0 %}
<main id="page" role="main">
{% for category in tag.categories %}
<div class="col pane ui-layout-{% assign counter=counter | plus:1 %}" id="{{ page.id }}">
<div class="colheader">
<div class="bar"></div>
<p class="lead">Leadin text</p>
<h1>{{ category | first }}</h1>
</div>
<div class="colscroll unlock">
{% for posts in category %}
{% for post in tag.posts %}
<div class="colblock" itemscope itemtype="http://schema.org/BlogPosting">
<div class="excerpt">
<time class="date" datetime="{{ page.date | '%Y-%m-%dT%H:%i:%S-08:00' }}" itemprop="datePublished">
{{ page.date | date: '%B %d, %Y' }}
</time>
<h1>
<a itemprop="url" href="{{ post.url }}" target="_blank" title="{{ post.title }}">
<span itemprop="name" itemprop=name>{{ post.title }}</span>
</a>
</h1>
<p itemprop="description">
{{ post.excerpt }}..
</p>
<p class="link_tags">{{ page.tags }}</p>
</div>
</div>
{% endfor %}
{% endfor %}
</div>
</div>
{% endfor %}
</main>
{% endif %}
{% endfor %}
{% endfor %}
</ul>
The live site template is up on Github. (tags list is the second circular icon from the left at the top of the page)
I think this is what you are looking for:
---
layout: default
---
<main id="page" role="main">
{% for category in site.categories %}
{% assign counter=0 %}
{% for posts in category %}
{% for post in posts %}
{% if post.tags contains page.tag %}
{% assign counter=counter | plus:1 %}
{% endif %}
{% endfor %}
{% endfor %}
{% if counter != 0 %}
<div class="col pane ui-layout-{% assign counter=counter | plus:1 %}" id="{{ page.id }}">
<div class="colheader">
<div class="bar"></div>
<p class="lead">Leadin text</p>
<h1>{{ category | first }}</h1>
</div>
<div class="colscroll unlock">
{% for posts in category %}
{% for post in posts %}
{% if post.tags contains page.tag %}
<div class="colblock" itemscope itemtype="http://schema.org/BlogPosting">
<div class="excerpt">
<time class="date" datetime="{{ page.date | '%Y-%m-%dT%H:%i:%S-08:00' }}" itemprop="datePublished">
{{ page.date | date: '%B %d, %Y' }}
</time>
<h1>
<a itemprop="url" href="{{ post.url }}" target="_blank" title="{{ post.title }}">
<span itemprop="name" itemprop=name>{{ post.title }}</span>
</a>
</h1>
<p itemprop="description">
{{ post.excerpt }}..
</p>
<p class="link_tags">{{ page.tags }}</p>
</div>
</div>
{% endif %}
{% endfor %}
{% endfor %}
</div>
</div>
{% endif %}
{% endfor %}
</main>
I've just modified your homepage code.
Edit: Added conditional code. Print only categories that contains posts with current tag.