Skip to content

Instantly share code, notes, and snippets.

.svg-background-image (@filename:@filename){
background-repeat: no-repeat;
.svg &{
background-image: url("@{i-folder}@{filename}.svg");
}
.no-svg &{
background-image: url("@{i-folder}@{filename}.png");
}
}
@joliveras
joliveras / HTML: Basic Template
Last active October 22, 2015 11:41
HTML: Basic Template
<!doctype html>
<html lang="es">
<head>
<meta charset="utf-8" />
<title>Page Title</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="description" content="">
@joliveras
joliveras / Wordpress: Loop: Blog Basic
Last active August 29, 2015 14:02
Wordpress: Loop: Blog Basic
<?php while (have_posts()) : the_post(); ?>
<h1>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Enlace a: <?php the_title(); ?>">
<?php the_title(); ?>
</a>
</h1>
<p><?php the_time('F jS, Y') ?></p>
<p><?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
<?php the_excerpt(); ?>
@joliveras
joliveras / Wordpress: Loop: Alternative Loop
Last active August 29, 2015 14:02
Wordpress: Loop: Alternative Loop
<?php
$args = array(
'posts_per_page' => 3,
'cat' => 8,
'offset' => 1
);
$loop_alternativo = new WP_Query($args);
if( $loop_alternativo->have_posts() ):
while( $loop_alternativo->have_posts() ): $loop_alternativo->the_post();
the_title();
@joliveras
joliveras / HTML: Newsletter basic
Last active August 29, 2015 14:03
newsletter basic structure
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Newsletter</title>
</head>
<body>
@joliveras
joliveras / CSS: Checkbox styled
Created July 3, 2014 12:31
CSS: Checkbox styled
input[type="checkbox"]{
display: none;
}
input[type="checkbox"] + label:before{
content: "";
background-color: #fff;
width: 16px;
height: 16px;
display: inline-block;
@joliveras
joliveras / Wordpress: Shortcode list child pages
Last active August 29, 2015 14:03
Function for create a shortcode to display subpages
<?php function childpages_shortcode( $atts ) {
global $post;
$args = array(
'post_parent' => $post->ID,
'post_type' => 'page',
'depth' => 1,
'orderby' => 'menu_order',
'order' => 'ASC'
@joliveras
joliveras / Excerpt link
Last active August 29, 2015 14:05
Wordpress: Excerpt read more link with language support
@joliveras
joliveras / SCSS: blockquote
Created September 1, 2014 10:47
Quotes on blockquote
blockquote {
quotes: "\201C""\201D""\2018""\2019";
&:before {
content: open-quote;
}
&:after {
content: close-quote;
}
}
@joliveras
joliveras / Gulp: gulp.js
Last active August 29, 2015 14:17
Gulp config file
// Use "gulp watch" in the console
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
concat = require('gulp-concat'),