Skip to content

Instantly share code, notes, and snippets.

View andreibabor's full-sized avatar

Andrei Babor andreibabor

View GitHub Profile
@andreibabor
andreibabor / WP - Show Related Posts by Category
Last active June 4, 2020 13:06
WP - Show Related Posts by Category
@andreibabor
andreibabor / jQuery
Created February 28, 2018 10:09
Determine viewport size with jQuery
$(window).ready(function() {
var viewport = $(window).width();
if ( viewport <= 759 ) {
console.log( "Mobile,", viewport ) ;}
else if ( viewport <= 1040 ) {
console.log( "Tablet,", viewport ) ;}
else {
console.log( "Desktop,", viewport )
@andreibabor
andreibabor / Shopify
Last active March 25, 2019 11:54
IP Redirect with cookie to visit 1st time
//mai trebuie adaugat js.cookie.js
//mai multe info https://alexcican.com/post/set-cookies-javascript/
{% if settings.redirect_use %}
{{ "js.cookie.js" | asset_url | script_tag }}
{% include 'redirect-message' %}
{{ 'redirect.js' | asset_url | script_tag }}
<script>
$(document).ready(function() {
@andreibabor
andreibabor / gist:22360ae9cc665041ceb1171393932f8f
Created March 1, 2018 11:43 — forked from 6ui11em/gist:2252065
CSS: Bootstrap center nav-pills in a row
.nav-tabs > li, .nav-pills > li {
float:none;
display:inline-block;
*display:inline; /* ie7 fix */
zoom:1; /* hasLayout ie7 trigger */
}
.nav-tabs {
text-align:center;
}
@andreibabor
andreibabor / shopify split collection description in 2 paragraphs
Last active December 7, 2018 13:13
split collection description in 2 paragraphs
//alt code smecher de la un client
{% assign descriptions = product.description | split: "<h5>" %}
{% for description_block in descriptions %}
{% if forloop.first == true %}
{{ description_block }}
{% else %}
@andreibabor
andreibabor / wp htaccss on different folder
Created March 14, 2018 18:38
Wp htaccess htaccss on different folder
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /staging/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /staging/index.php [L]
</IfModule>
@andreibabor
andreibabor / Wp loop through post and pages
Created March 21, 2018 19:40
Wp loop through post and pages
<div id="main-boxes">
<div class="container">
<div class="row">
<?php
$args = array(
'numberposts' => 6,
'post_status'=>"publish",
'post_type'=>"expedition",// was post
'orderby'=>"post_author",
'cat' => 29
@andreibabor
andreibabor / Google
Created March 22, 2018 10:58
Tell Google to Not Index Certain Parts of Your Page
<p>This is normal (X)HTML content that will be indexed by Google.</p>
<!--googleoff: index-->
<p>This (X)HTML content will NOT be indexed by Google.</p>
<!--googleon: index>
@andreibabor
andreibabor / Shopify Ip Redirect on Product
Created March 29, 2018 07:30
Shopify Ip Redirect on Product
1.adaugi {% include 'redirect-product-page' %} in product.liquid
2.open {% include 'redirect-product-page' %} si pui codul de mai jos:
{% if settings.redirect_use %}
{% include 'redirect-message' %}
{{ 'redirect.js' | asset_url | script_tag }}
<script>
IPRedirect.init({{ settings | json }});
IPRedirect.run();
</script>
@andreibabor
andreibabor / Css Selector
Created March 29, 2018 13:05
Css Selector
[data-dropdown-rel |= videos] {color:red;}
<li><a href="#" class=" top_link " data-dropdown-rel="videos">Videos</a></li>
si afiseaza rosu la videos